Skip to content

Commit

Permalink
[Intl] Fixed tests failing on PHP 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jakzal committed Jun 21, 2013
1 parent e01c6c2 commit 3492186
Showing 1 changed file with 5 additions and 16 deletions.
Expand Up @@ -850,27 +850,16 @@ public function testSetTimeZoneId($timeZoneId, $expectedTimeZoneId)

public function setTimeZoneIdProvider()
{
$data = array(
return array(
array('UTC', 'UTC'),
array('GMT', 'GMT'),
array('GMT-03:00', 'GMT-03:00'),
array('Europe/Zurich', 'Europe/Zurich'),
array('GMT-0300', 'GMT-0300'),
array('Foo/Bar', 'Foo/Bar'),
array('GMT+00:AA', 'GMT+00:AA'),
array('GMT+00AA', 'GMT+00AA'),
);

// When time zone not exists, uses UTC by default
if (version_compare(PHP_VERSION, '5.5.0-dev', '>=')) {
$data[] = array('GMT-0300', 'UTC');
$data[] = array('Foo/Bar', 'UTC');
$data[] = array('GMT+00:AA', 'UTC');
$data[] = array('GMT+00AA', 'UTC');
} else {
$data[] = array('GMT-0300', 'GMT-0300');
$data[] = array('Foo/Bar', 'Foo/Bar');
$data[] = array('GMT+00:AA', 'GMT+00:AA');
$data[] = array('GMT+00AA', 'GMT+00AA');
}

return $data;
}

protected function getDefaultDateFormatter($pattern = null)
Expand Down

1 comment on commit 3492186

@webmozart
Copy link
Contributor

Choose a reason for hiding this comment

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

Which exact PHP version was this fix for? I just ran this test on 5.5.12 with ICU 51 and it fails for me (but succeeds on 5.4.28 with ICU 51):

phpunit src/Symfony/Component/Intl/Tests/DateFormatter/Verification/IntlDateFormatterTest.php 
PHPUnit 4.1.0 by Sebastian Bergmann.

Configuration read from phpunit.xml.dist

S..............................................................  63 / 327 ( 19%)
............................................................... 126 / 327 ( 38%)
............................................................... 189 / 327 ( 57%)
............................................................... 252 / 327 ( 77%)
............................................................... 315 / 327 ( 96%)
........FFFF

Time: 814 ms, Memory: 7.00Mb

There were 4 failures:

1) Symfony\Component\Intl\Tests\DateFormatter\Verification\IntlDateFormatterTest::testSetTimeZoneId with data set #4 ('GMT-0300', 'GMT-0300')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'GMT-0300'
+'UTC'

src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php:852

2) Symfony\Component\Intl\Tests\DateFormatter\Verification\IntlDateFormatterTest::testSetTimeZoneId with data set #5 ('Foo/Bar', 'Foo/Bar')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Foo/Bar'
+'UTC'

src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php:852

3) Symfony\Component\Intl\Tests\DateFormatter\Verification\IntlDateFormatterTest::testSetTimeZoneId with data set #6 ('GMT+00:AA', 'GMT+00:AA')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'GMT+00:AA'
+'UTC'

src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php:852

4) Symfony\Component\Intl\Tests\DateFormatter\Verification\IntlDateFormatterTest::testSetTimeZoneId with data set #7 ('GMT+00AA', 'GMT+00AA')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'GMT+00AA'
+'UTC'

src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php:852

FAILURES!                                             
Tests: 327, Assertions: 1979, Failures: 4, Skipped: 1.

Please sign in to comment.