Skip to content

Commit 90f73d2

Browse files
committed
Add failing test case for millisecond-precision dates before 1970.
1 parent f234065 commit 90f73d2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/ModelTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,10 @@ public function testDates(): void
429429
$user = User::create(['name' => 'Jane Doe', 'birthday' => new DateTime('2010-08-08 04.08.37.324')]);
430430
$this->assertInstanceOf(Carbon::class, $user->birthday);
431431

432+
// test millisecond-precision dates before 1970:
433+
$user = User::create(['name' => 'Jane Doe', 'birthday' => new DateTime('1965-08-08 04.08.37.324')]);
434+
$this->assertInstanceOf(Carbon::class, $user->birthday);
435+
432436
$user = User::create(['name' => 'Jane Doe', 'entry' => ['date' => '2005-08-08']]);
433437
$this->assertInstanceOf(Carbon::class, $user->getAttribute('entry.date'));
434438

0 commit comments

Comments
 (0)