[Intl] Added a check for the ICU data version to IntlTestHelper to prevent the stub class tests from failing
This commit is contained in:
parent
427d24a7a7
commit
e2c11cb81a
@ -43,6 +43,10 @@ class IntlTestHelper
|
|||||||
$testCase->markTestSkipped('Please change ICU version to ' . Intl::getIcuStubVersion());
|
$testCase->markTestSkipped('Please change ICU version to ' . Intl::getIcuStubVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IcuVersion::compare(Intl::getIcuDataVersion(), Intl::getIcuStubVersion(), '!=', $precision = 1)) {
|
||||||
|
$testCase->markTestSkipped('Please change the Icu component to version 1.0.x or 1.' . IcuVersion::normalize(Intl::getIcuStubVersion(), 1) . '.x');
|
||||||
|
}
|
||||||
|
|
||||||
// Normalize the default locale in case this is not done explicitly
|
// Normalize the default locale in case this is not done explicitly
|
||||||
// in the test
|
// in the test
|
||||||
\Locale::setDefault('en');
|
\Locale::setDefault('en');
|
||||||
@ -70,11 +74,16 @@ class IntlTestHelper
|
|||||||
$testCase->markTestSkipped('The intl extension is not available.');
|
$testCase->markTestSkipped('The intl extension is not available.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// ... and only if the version is *one specific version*.
|
// ... and only if the version is *one specific version* ...
|
||||||
if (IcuVersion::compare(Intl::getIcuVersion(), Intl::getIcuStubVersion(), '!=', $precision = 1)) {
|
if (IcuVersion::compare(Intl::getIcuVersion(), Intl::getIcuStubVersion(), '!=', $precision = 1)) {
|
||||||
$testCase->markTestSkipped('Please change ICU version to ' . Intl::getIcuStubVersion());
|
$testCase->markTestSkipped('Please change ICU version to ' . Intl::getIcuStubVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ... and only if the data in the Icu component matches that version.
|
||||||
|
if (IcuVersion::compare(Intl::getIcuDataVersion(), Intl::getIcuStubVersion(), '!=', $precision = 1)) {
|
||||||
|
$testCase->markTestSkipped('Please change the Icu component to version 1.0.x or 1.' . IcuVersion::normalize(Intl::getIcuStubVersion(), 1) . '.x');
|
||||||
|
}
|
||||||
|
|
||||||
// Normalize the default locale in case this is not done explicitly
|
// Normalize the default locale in case this is not done explicitly
|
||||||
// in the test
|
// in the test
|
||||||
\Locale::setDefault('en');
|
\Locale::setDefault('en');
|
||||||
|
Reference in New Issue
Block a user