Skip to content

Commit

Permalink
added coverage for createdAt,updatedAt traits
Browse files Browse the repository at this point in the history
  • Loading branch information
jeyroik committed Apr 13, 2020
1 parent 3e8435d commit 0ac2708
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/TraitsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ public function testHasUpdatedAt()

$this->assertEquals($now, $test->getUpdatedAt());
$this->assertEquals(date($format, $now), $test->getUpdatedAt($format));

$test->setUpdatedAt(new DateTime(date('Y/m/d H:i:s', $now)));
$this->assertEquals(date($format, $now), $test->getUpdatedAt($format));

$test->setUpdatedAt(date('Y/m/d H:i:s', $now));
$this->assertEquals(date($format, $now), $test->getUpdatedAt($format));
}

public function testHasCreatedAt()
Expand All @@ -197,6 +203,12 @@ public function testHasCreatedAt()

$this->assertEquals($now, $test->getCreatedAt());
$this->assertEquals(date($format, $now), $test->getCreatedAt($format));

$test->setCreatedAt(new DateTime(date('Y/m/d H:i:s', $now)));
$this->assertEquals(date($format, $now), $test->getCreatedAt($format));

$test->setCreatedAt(date('Y/m/d H:i:s', $now));
$this->assertEquals(date($format, $now), $test->getCreatedAt($format));
}

public function testHasAliases()
Expand Down

0 comments on commit 0ac2708

Please sign in to comment.