Closed
Description
- Laravel Version: v5.6.17
- PHP Version: 7.1.17
Description:
When using a model factory with a fixed date the microseconds are lost. This means when asserting in a unit test dates do not match when they should.
Steps To Reproduce:
public function some_test() {
Carbon::setTestNow(new Carbon());
$t = factory(Model::class)->make(['date_field' => Carbon::now()->addWeeks(2)]);
$this->assertEquals($t->date_field, Carbon::now()->addWeeks(2));
}
Failed asserting that two DateTime objects are equal.
--- Expected
+++ Actual
@@ @@
-2018-05-28T21:53:00.000000+0000
+2018-05-28T21:53:00.613965+0000
Metadata
Metadata
Assignees
Labels
No labels