class IntlTestHelper{ /**
* Should be called before tests that work fine with the stub implementation.
*
* @return void
*/
public static function requireIntl(TestCase
$testCase, string
$minimumIcuVersion = null
) { $minimumIcuVersion ??= Intl::
getIcuStubVersion();
// We only run tests if the version is *one specific version*.
// This condition is satisfied if
//
// * the intl extension is loaded with version Intl::getIcuStubVersion()
// * the intl extension is not loaded
if ($minimumIcuVersion && IcuVersion::
compare(Intl::
getIcuVersion(),
$minimumIcuVersion, '<', 1
)) { $testCase->
markTestSkipped('ICU version '.
$minimumIcuVersion.' is required.'
);
}