Browse Source

added test to verify #15298

tags/2.0.16
Carsten Brandt 7 years ago
parent
commit
314b66827b
No known key found for this signature in database
GPG Key ID: BE4F41DE1DEEEED0
  1. 16
      tests/framework/helpers/FormatConverterTest.php

16
tests/framework/helpers/FormatConverterTest.php

@ -103,5 +103,21 @@ class FormatConverterTest extends TestCase
$expected = "'dDjlNSwZWFmMntLoYyaBghHisueIOPTZcru'";
$actual = FormatConverter::convertDatePhpToIcu('\d\D\j\l\N\S\w\Z\W\F\m\M\n\t\L\o\Y\y\a\B\g\h\H\i\s\u\e\I\O\P\T\Z\c\r\u');
$this->assertEquals($expected, $actual);
$expected = "yyyy-MM-dd'T'HH:mm:ssxxx";
$actual = FormatConverter::convertDatePhpToIcu('c');
$this->assertEquals($expected, $actual);
}
public function testPhpFormatC()
{
$time = time();
$formatter = new Formatter(['locale' => 'en-US']);
$this->assertEquals(date('c', $time), $formatter->asDatetime($time, 'php:c'));
date_default_timezone_set('Europe/Moscow');
$formatter = new Formatter(['locale' => 'ru-RU', 'timeZone' => 'Europe/Moscow']);
$this->assertEquals(date('c', $time), $formatter->asDatetime($time, 'php:c'));
}
}

Loading…
Cancel
Save