Skip to content

Commit 468ea75

Browse files
committed
test: cover parsing from icu format
1 parent d1c9daa commit 468ea75

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/datetime/tests/DateTimeTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,14 @@ public function test_parse(): void
238238
$this->assertSame($datetime->getTimezone(), $parsed->getTimezone());
239239
}
240240

241+
public function test_parse_icu(): void
242+
{
243+
$parsed = DateTime::fromPattern('2025-01-01 10:00', pattern: 'yyyy-MM-dd HH:mm');
244+
245+
$this->assertEquals('2025-01-01 10:00', $parsed->format(pattern: 'yyyy-MM-dd HH:mm'));
246+
$this->assertEquals(1735725600, $parsed->getTimestamp()->getSeconds());
247+
}
248+
241249
public function test_parse_timestamp(): void
242250
{
243251
$expected = DateTime::fromTimestamp(1747670452940);

0 commit comments

Comments
 (0)