Skip to content

Commit 7bd92db

Browse files
committed
Remove test and revert back old test
1 parent 31b0fdf commit 7bd92db

File tree

3 files changed

+6
-112
lines changed

3 files changed

+6
-112
lines changed

tests/DatabaseEloquentTimestampsTest.php

Lines changed: 0 additions & 107 deletions
This file was deleted.

tests/ModelTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,12 @@ public function testDates(): void
405405
->getTimestamp(), $item->created_at->getTimestamp());
406406
$this->assertLessThan(2, abs(time() - $item->created_at->getTimestamp()));
407407

408+
// test default date format for json output
409+
/** @var Item $item */
410+
$item = Item::create(['name' => 'sword']);
411+
$json = $item->toArray();
412+
$this->assertEquals($item->created_at->format('Y-m-d\TH:i:s.u\Z'), $json['created_at']);
413+
408414
/** @var User $user */
409415
$user = User::create(['name' => 'Jane Doe', 'birthday' => time()]);
410416
$this->assertInstanceOf(Carbon::class, $user->birthday);

tests/models/User.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,4 @@ public function photos()
6767
{
6868
return $this->morphMany('Photo', 'imageable');
6969
}
70-
71-
public function getDateFormat()
72-
{
73-
return 'l jS \of F Y h:i:s A';
74-
}
7570
}

0 commit comments

Comments
 (0)