[Locale] Fixed failing StubNumberFormatterTest when intl extension is not loaded
This commit is contained in:
parent
71c99422f3
commit
33e70673c2
@ -188,11 +188,15 @@ class StubNumberFormatterTest extends LocaleTestCase
|
|||||||
|
|
||||||
public function formatCurrencyWithCurrencyStyleSwissRoundingProvider()
|
public function formatCurrencyWithCurrencyStyleSwissRoundingProvider()
|
||||||
{
|
{
|
||||||
|
$chf = 'CHF';
|
||||||
|
|
||||||
// The currency symbol was updated from 4.2 to the 4.4 version. The ICU CLDR data was updated in 2010-03-03,
|
// The currency symbol was updated from 4.2 to the 4.4 version. The ICU CLDR data was updated in 2010-03-03,
|
||||||
// the 4.2 release is from 2009-05-08 and the 4.4 from 2010-03-17. It's ugly we want to compare if the
|
// the 4.2 release is from 2009-05-08 and the 4.4 from 2010-03-17. It's ugly we want to compare if the
|
||||||
// stub implementation is behaving like the intl one
|
// stub implementation is behaving like the intl one
|
||||||
// http://bugs.icu-project.org/trac/changeset/27776/icu/trunk/source/data/curr/en.txt
|
// http://bugs.icu-project.org/trac/changeset/27776/icu/trunk/source/data/curr/en.txt
|
||||||
$chf = $this->isLowerThanIcuVersion('4.4') ? 'Fr.' : 'CHF';
|
if ($this->isIntlExtensionLoaded() && $this->isLowerThanIcuVersion('4.4')) {
|
||||||
|
$chf = 'Fr.';
|
||||||
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
array(100, 'CHF', $chf, '%s100.00'),
|
array(100, 'CHF', $chf, '%s100.00'),
|
||||||
|
@ -78,6 +78,10 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase
|
|||||||
return self::$icuVersion;
|
return self::$icuVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$this->isIntlExtensionLoaded()) {
|
||||||
|
throw new \RuntimeException('The intl extension is not available');
|
||||||
|
}
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
phpinfo(INFO_MODULES);
|
phpinfo(INFO_MODULES);
|
||||||
$output = ob_get_clean();
|
$output = ob_get_clean();
|
||||||
|
Reference in New Issue
Block a user