summaryrefslogtreecommitdiffstats
path: root/tests/unit/fetcher/FeedFetcherTest.php
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-10-22 11:35:12 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-10-22 11:35:12 +0200
commitc102123dc902b855842d3e9942b4629abba83ebb (patch)
tree8d3058583cc0727ef79daa6d5ab34b2dd669fb0e /tests/unit/fetcher/FeedFetcherTest.php
parentdc8b8301d387d48e38624423cba9cf5323f26291 (diff)
add caching
Diffstat (limited to 'tests/unit/fetcher/FeedFetcherTest.php')
-rw-r--r--tests/unit/fetcher/FeedFetcherTest.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/unit/fetcher/FeedFetcherTest.php b/tests/unit/fetcher/FeedFetcherTest.php
index db954d952..a0bd0b866 100644
--- a/tests/unit/fetcher/FeedFetcherTest.php
+++ b/tests/unit/fetcher/FeedFetcherTest.php
@@ -121,7 +121,10 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase {
->method('getEtag')
->will($this->returnValue($this->etag));
- if ($noParser) {
+ if (!$modified) {
+ $this->reader->expects($this->never())
+ ->method('getParser');
+ } else if ($noParser) {
$this->reader->expects($this->once())
->method('getParser')
->will($this->returnValue(false));
@@ -141,10 +144,9 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase {
}
}
- // uncomment if testing caching
- /*$this->client->expects($this->once())
+ $this->client->expects($this->once())
->method('isModified')
- ->will($this->returnValue($modified));*/
+ ->will($this->returnValue($modified));
}
@@ -234,6 +236,11 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase {
$this->fetcher->fetch($this->url);
}
+ public function testNoFetchIfNotModified(){
+ $this->setUpReader($this->url, false);;
+ $result = $this->fetcher->fetch($this->url);
+ }
+
public function testFetch(){
$this->setUpReader($this->url);
$item = $this->createItem();