Skip to content

Commit

Permalink
Merge pull request #89 from alexdebril/issue/88
Browse files Browse the repository at this point in the history
Fix #88
  • Loading branch information
alexdebril authored Jun 3, 2017
2 parents a02d6c6 + df2ba2b commit 6bc11dd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/FeedIo/FeedIo.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,20 @@ public function getBaseFixers()

);
}


/**
* @param array $formats
* @return $this
*/
public function addDateFormats(array $formats)
{
foreach( $formats as $format ) {
$this->getDateTimeBuilder()->addDateFormat($format);
}

return $this;
}

/**
* @return \FeedIo\Rule\DateTimeBuilder
*/
Expand Down
7 changes: 7 additions & 0 deletions tests/FeedIo/FeedIoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ public function testGetCommonStandards()
}
}

public function testAddDateFormats()
{
$this->object->addDateFormats(['YYYY/M/Y']);

$this->assertAttributeContains('YYYY/M/Y', 'dateFormats', $this->object->getDateTimeBuilder());
}

public function testFixerSet()
{
$this->assertInstanceOf('\FeedIo\Reader\FixerSet', $this->object->getFixerSet());
Expand Down

0 comments on commit 6bc11dd

Please sign in to comment.