Skip to content
Permalink
Browse files

Fix up failing tests when run against new versions of libicu.

Refs #12158
  • Loading branch information...
markstory committed May 30, 2018
1 parent cfaa31c commit f07140d5f4dc1645506bc4bcf2080061adf1ae67
Showing with 11 additions and 5 deletions.
  1. +4 −4 tests/TestCase/I18n/DateTest.php
  2. +7 −1 tests/TestCase/I18n/TimeTest.php
@@ -108,16 +108,16 @@ public function testI18nFormat($class)
$class::setDefaultLocale('fr-FR');
$result = $time->i18nFormat(\IntlDateFormatter::FULL);
$result = str_replace(' à', '', $result);
$expected = 'jeudi 14 janvier 2010 00:00:00 UTC';
$this->assertEquals($expected, $result);
$expected = 'jeudi 14 janvier 2010 00:00:00';
$this->assertContains($expected, $result);
$result = $time->i18nFormat(\IntlDateFormatter::FULL, null, 'es-ES');
$this->assertContains('14 de enero de 2010', $result, 'Default locale should not be used');
$time = new $class('2014-01-01T00:00:00Z');
$result = $time->i18nFormat(\IntlDateFormatter::FULL, null, 'en-US');
$expected = 'Wednesday, January 1, 2014 at 12:00:00 AM GMT';
$this->assertEquals($expected, $result);
$expected = 'Wednesday, January 1, 2014 at 12:00:00 AM';
$this->assertContains($expected, $result);
}
/**
@@ -467,7 +467,7 @@ public function testI18nFormat($class)
$this->assertTimeFormat($expected, $result);
$result = $time->i18nFormat(\IntlDateFormatter::FULL, null, 'ps-IR@calendar=persian');
$expected = 'پنجشنبه د ۱۳۸۸ د مرغومی ۲۴ ۱۳:۵۹:۲۸ (GMT)';
$expected = 'پينځنۍ د ۱۳۸۸ د مرغومی ۲۴ ۱۳:۵۹:۲۸ (GMT)';
$this->assertTimeFormat($expected, $result);
$result = $time->i18nFormat(\IntlDateFormatter::FULL, null, 'en-KW@calendar=islamic');
@@ -917,8 +917,14 @@ public function assertTimeFormat($expected, $result, $message = '')
$expected = str_replace([',', '(', ')', ' at', ' م.', ' ه‍.ش.', ' AP', ' AH', ' SAKA', 'à '], '', $expected);
$expected = str_replace([' '], ' ', $expected);
$result = str_replace('Temps universel coordonné', 'UTC', $result);
$result = str_replace('tiempo universal coordinado', 'GMT', $result);
$result = str_replace('Coordinated Universal Time', 'GMT', $result);
$result = str_replace([',', '(', ')', ' at', ' م.', ' ه‍.ش.', ' AP', ' AH', ' SAKA', 'à '], '', $result);
$result = str_replace(['گرینویچ'], 'GMT', $result);
$result = str_replace('زمان هماهنگ جهانی', 'GMT', $result);
$result = str_replace('همغږۍ نړیواله موده', 'GMT', $result);
$result = str_replace([' '], ' ', $result);
$this->assertSame($expected, $result, $message);

0 comments on commit f07140d

Please sign in to comment.
You can’t perform that action at this time.