Add failing test case for millisecond-precision dates before 1970.

parent f2340655
......@@ -429,6 +429,10 @@ class ModelTest extends TestCase
$user = User::create(['name' => 'Jane Doe', 'birthday' => new DateTime('2010-08-08 04.08.37.324')]);
$this->assertInstanceOf(Carbon::class, $user->birthday);
// test millisecond-precision dates before 1970:
$user = User::create(['name' => 'Jane Doe', 'birthday' => new DateTime('1965-08-08 04.08.37.324')]);
$this->assertInstanceOf(Carbon::class, $user->birthday);
$user = User::create(['name' => 'Jane Doe', 'entry' => ['date' => '2005-08-08']]);
$this->assertInstanceOf(Carbon::class, $user->getAttribute('entry.date'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment