diff --git a/src/Symfony/Component/Locale/Tests/Stub/StubNumberFormatterTest.php b/src/Symfony/Component/Locale/Tests/Stub/StubNumberFormatterTest.php index 9471f820d1..7f033a31a9 100644 --- a/src/Symfony/Component/Locale/Tests/Stub/StubNumberFormatterTest.php +++ b/src/Symfony/Component/Locale/Tests/Stub/StubNumberFormatterTest.php @@ -210,7 +210,7 @@ class StubNumberFormatterTest extends LocaleTestCase public function formatCurrencyWithCurrencyStyleBrazilianRealRoundingProvider() { - $brl = $this->isIntlExtensionLoaded() && $this->isSameAsIcuVersion('4.8') ? 'BR' : 'R'; + $brl = $this->isIntlExtensionLoaded() && $this->isGreaterOrEqualThanIcuVersion('4.8') ? 'BR' : 'R'; return array( array(100, 'BRL', $brl, '%s$100.00'), diff --git a/src/Symfony/Component/Locale/Tests/TestCase.php b/src/Symfony/Component/Locale/Tests/TestCase.php index b6483285a2..1cc2e9fcfb 100644 --- a/src/Symfony/Component/Locale/Tests/TestCase.php +++ b/src/Symfony/Component/Locale/Tests/TestCase.php @@ -89,7 +89,16 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase protected function normalizeIcuVersion($version) { - return ((float) $version) * 100; + $versionIds = explode(".", $version); + + $multi = 1000; + $intVersion = 0; + foreach ($versionIds as $id) { + $intVersion += $id * $multi; + $multi = $multi/10; + } + + return (int) $intVersion; } protected function getIntlExtensionIcuVersion()