Skip to content

Issue #5288 fix #6109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public function testFormatCurrencyWithCurrencyStyleBrazilianRealRoundingIntl($va

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'),
Expand Down
11 changes: 10 additions & 1 deletion src/Symfony/Component/Locale/Tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,16 @@ protected function isLowerThanIcuVersion($version)

protected function normalizeIcuVersion($version)
{
return ((float) $version) * 100;
$versionIds = explode(".", $version);

$multi = 1000;
$intVersion = 0;
foreach ($versionIds as $id) {
$intVersion += $id * $multi;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some spaces are missing. Can be fixed with php-cs-fixer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already fixed

$multi = $multi/10;
}

return (int) $intVersion;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change this method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After installing symfony during the hack day the test was failing on my machine and an other person on Ubuntu 12.10. So I guessed that it was fixed in a later version of the ICU.

So I made the function more detailed so that also the number behind the second dot of the version is taken into account.

It now is correct on my local machine but it fails on Travis. So I need to figure out where the change is in the ICU lib to find the correct version number to switch from BR to R.

}

protected function getIntlExtensionIcuVersion()
Expand Down