diff options
author | Daniel Schaal <daniel@schaal.email> | 2017-01-04 11:09:46 +0100 |
---|---|---|
committer | Bernhard Posselt <BernhardPosselt@users.noreply.github.com> | 2017-01-04 11:09:46 +0100 |
commit | 04f66c9710faf9438adcc69028eed082c98a5178 (patch) | |
tree | 3e11906b5e318b0fdddccfe6e8b9d30af44dcb0f /tests/Unit/Fetcher/FeedFetcherTest.php | |
parent | 41932775bcf79d5f80060e87b5051bd9b5937c5f (diff) |
Add updatedDate to item model (#81)
* Update picoFeed to v0.1.28
* Add updated_date to database and bump version to 10.1.1
* Add updatedDate to item model
* Check for updatedDate when updating a feed
* Fix unit test to check for newer updatedDate
Diffstat (limited to 'tests/Unit/Fetcher/FeedFetcherTest.php')
-rw-r--r-- | tests/Unit/Fetcher/FeedFetcherTest.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/Unit/Fetcher/FeedFetcherTest.php b/tests/Unit/Fetcher/FeedFetcherTest.php index 5266f0708..930cf4c99 100644 --- a/tests/Unit/Fetcher/FeedFetcherTest.php +++ b/tests/Unit/Fetcher/FeedFetcherTest.php @@ -38,6 +38,7 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase { private $title; private $guid; private $pub; + private $updated; private $body; private $author; private $enclosureLink; @@ -110,6 +111,7 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase { $this->body2 = 'let the bodies hit the floor ' . '<a target="_blank" href="test">test</a>'; $this->pub = 23111; + $this->updated = 23444; $this->author = '<boogieman'; $this->enclosureLink = 'http://enclosure.you'; @@ -209,11 +211,15 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase { $item = new Item(); date_default_timezone_set('America/Los_Angeles'); - $date = new \DateTime(); - $date->setTimestamp($this->pub); - $this->expectItem('getDate', $date); + + $pubdate = \Datetime::createFromFormat('U',$this->pub); + $this->expectItem('getPublishedDate', $pubdate); $item->setPubDate($this->pub); + $update = \Datetime::createFromFormat('U',$this->updated); + $this->expectItem('getUpdatedDate', $update); + $item->setUpdatedDate($this->updated); + $item->setStatus(0); $item->setUnread(); $item->setUrl($this->permalink); |