diff --git a/tests/FactoryMuffTest.php b/tests/FactoryMuffTest.php index f421824..0344088 100644 --- a/tests/FactoryMuffTest.php +++ b/tests/FactoryMuffTest.php @@ -11,7 +11,7 @@ public function setUp() $this->factory = new FactoryMuff(); } - public function test_defauling_to_faker() + public function test_defaulting_to_faker() { $obj = $this->factory->create('SampleModelB'); $this->assertInternalType('array', $obj->card); @@ -34,26 +34,15 @@ public function test_should_get_attributes_for() public function test_date_kind() { - $this->markTestSkipped('Need to check the date format is correct, no the exact date (it is random now)'); - - $this->factory->define('SampleModelA', array( - 'created' => 'date|Ymd', - )); - - $obj = $this->factory->create('SampleModelA'); - $this->assertEquals($obj->created, date('Ymd')); - } - - public function test_date_kind_with_date() - { - $this->markTestSkipped('Need to check the date format is correct, no the exact date (it is random now)'); - + $format = 'Y-m-d'; + $this->factory->define('SampleModelA', array( - 'created' => 'date|Ymd h:s', + 'created' => 'date|' . $format, )); $obj = $this->factory->create('SampleModelA'); - $this->assertEquals($obj->created, date('Ymd h:s')); + $dateTime = \DateTime::createFromFormat($format, $obj->created); + $this->assertEquals($obj->created, $dateTime->format($format)); } public function test_integer()