Skip to content

Commit

Permalink
Merge pull request #51 from jobrios/fix-date-test
Browse files Browse the repository at this point in the history
Fix for date kind test
  • Loading branch information
scottrobertson committed Jul 6, 2014
2 parents f71df5a + 8f23319 commit 7b9cf07
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions tests/FactoryMuffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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()
Expand Down

0 comments on commit 7b9cf07

Please sign in to comment.