summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-10-22 11:06:43 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-10-22 11:06:43 +0200
commitdc8b8301d387d48e38624423cba9cf5323f26291 (patch)
treebbc8f280f74f4f628d0f2720e410bf09f2134325 /tests
parentcc3fa38cee2e24dacb940ec5d7ca41e593aa824a (diff)
fix #302
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/db/FeedTest.php4
-rw-r--r--tests/unit/fetcher/FeedFetcherTest.php9
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/unit/db/FeedTest.php b/tests/unit/db/FeedTest.php
index 936948813..dd0c52da5 100644
--- a/tests/unit/db/FeedTest.php
+++ b/tests/unit/db/FeedTest.php
@@ -20,6 +20,8 @@ class FeedTest extends \PHPUnit_Framework_TestCase {
private function createFeed() {
$feed = new Feed();
$feed->setId(3);
+ $feed->setLastModified(44);
+ $feed->setEtag(45);
$feed->setUrl('http://google.com/some/weird/path');
$feed->setTitle('title');
$feed->setFaviconLink('favicon');
@@ -42,6 +44,8 @@ class FeedTest extends \PHPUnit_Framework_TestCase {
'added' => 123,
'folderId' => 1,
'unreadCount' => 321,
+ 'lastModified' => 44,
+ 'etag' => 45,
'link' => 'https://www.google.com/some/weird/path'
], $feed->toAPI());
}
diff --git a/tests/unit/fetcher/FeedFetcherTest.php b/tests/unit/fetcher/FeedFetcherTest.php
index 1f3b3d108..db954d952 100644
--- a/tests/unit/fetcher/FeedFetcherTest.php
+++ b/tests/unit/fetcher/FeedFetcherTest.php
@@ -44,6 +44,7 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase {
private $feedImage;
private $webFavicon;
private $modified;
+ private $etag;
protected function setUp(){
$this->reader = $this->getMockBuilder(
@@ -97,6 +98,7 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase {
$this->webFavicon = 'http://anon.google.com';
$this->authorMail = 'doe@joes.com';
$this->modified = 3;
+ $this->etag = 'yo';
}
@@ -115,6 +117,9 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase {
$this->client->expects($this->once())
->method('getLastModified')
->will($this->returnValue($this->modified));
+ $this->client->expects($this->once())
+ ->method('getEtag')
+ ->will($this->returnValue($this->etag));
if ($noParser) {
$this->reader->expects($this->once())
@@ -199,6 +204,8 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase {
$feed->setUrl($this->url);
$feed->setLink($this->feedLink);
$feed->setAdded($this->time);
+ $feed->setLastModified($this->modified);
+ $feed->setEtag($this->etag);
if($hasFavicon) {
$this->faviconFetcher->expects($this->once())
@@ -249,6 +256,8 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase {
$feed->setLink($this->feedLink);
$feed->setAdded($this->time);
$feed->setFaviconLink(null);
+ $feed->setLastModified($this->modified);
+ $feed->setEtag($this->etag);
$item = $this->createItem();
$this->expectFeed('getItems', [$this->item]);