Skip to content

Commit 475b5ec

Browse files
committed
Add test
1 parent c08b8bd commit 475b5ec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/Unit/Models/Attributes/TimestampTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ class TimestampTest extends TestCase
1313

1414
protected string $utcLdapTimestamp = '20201002021244Z';
1515

16+
protected string $utcLdapMillisecondsTimestamp = '20231106080944.000Z';
17+
1618
protected string $offsetLdapTimestamp = '20201002021244-0500';
1719

1820
protected string $utcWindowsTimestamp = '20201002021618.0Z';
@@ -83,6 +85,10 @@ public function test_ldap_type_can_be_converted_to_date()
8385
$this->assertInstanceOf(DateTime::class, $datetime);
8486
$this->assertEquals('-05:00', $datetime->timezone->getName());
8587
$this->assertEquals('Fri Oct 02 2020 02:12:44 GMT-0500', $datetime->toString());
88+
89+
$datetime = $timestamp->toDateTime($this->utcLdapMillisecondsTimestamp);
90+
$this->assertEquals('UTC', $datetime->timezone->getName());
91+
$this->assertEquals('Mon Nov 06 2023 08:09:44 GMT+0000', $datetime->toString());
8692
}
8793

8894
public function test_windows_type_can_be_converted_to_date()

0 commit comments

Comments
 (0)