summaryrefslogtreecommitdiffstats
path: root/tests/unit/fetcher/FeedFetcherTest.php
diff options
context:
space:
mode:
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();