Issue 5288 fix

This commit is contained in:
Iwan van Staveren 2012-11-24 15:35:35 +01:00
parent ee90986c9f
commit 12a890f7cb
2 changed files with 11 additions and 2 deletions

View File

@ -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'),

View File

@ -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()