summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-10-30 11:30:12 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2014-10-30 11:30:12 +0100
commit91f302245e14f4d40f9daa83aaef3000753d71d8 (patch)
tree3324982a3c590c855f0737b9ec606caf1f6722a7 /tests
parentb1e7d7b084b1feb579f37203d4a7c7880c970278 (diff)
also set the feed location
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/fetcher/FeedFetcherTest.php29
1 files changed, 6 insertions, 23 deletions
diff --git a/tests/unit/fetcher/FeedFetcherTest.php b/tests/unit/fetcher/FeedFetcherTest.php
index fad468d7a..3f837cdd8 100644
--- a/tests/unit/fetcher/FeedFetcherTest.php
+++ b/tests/unit/fetcher/FeedFetcherTest.php
@@ -47,6 +47,7 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase {
private $webFavicon;
private $modified;
private $etag;
+ private $location;
protected function setUp(){
$this->reader = $this->getMockBuilder(
@@ -133,6 +134,9 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase {
$this->client->expects($this->once())
->method('getEtag')
->will($this->returnValue($this->etag));
+ $this->client->expects($this->once())
+ ->method('getUrl')
+ ->will($this->returnValue($this->location));
if (!$modified) {
$this->reader->expects($this->never())
@@ -211,7 +215,7 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase {
private function createFeed($hasFavicon=false) {
$this->expectFeed('getTitle', $this->feedTitle);
- $this->expectFeed('getUrl', $this->feedLink, 2);
+ $this->expectFeed('getUrl', $this->feedLink);
$feed = new Feed();
$feed->setTitle('&its a title');
@@ -220,6 +224,7 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase {
$feed->setAdded($this->time);
$feed->setLastModified($this->modified);
$feed->setEtag($this->etag);
+ $feed->setLocation($this->location);
if($hasFavicon) {
$this->faviconFactory->expects($this->once())
@@ -267,28 +272,6 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase {
}
- public function testNoTitleUsesUrl(){
- $this->setUpReader($this->url);
- $this->expectFeed('getTitle', '');
- $this->expectFeed('getUrl', $this->feedLink, 2);
-
- $feed = new Feed();
- $feed->setTitle($this->url);
- $feed->setUrl($this->url);
- $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]);
- $result = $this->fetcher->fetch($this->url, false);
-
- $this->assertEquals([$feed, [$item]], $result);
- }
-
-
public function testAudioEnclosure(){
$this->setUpReader($this->url);
$item = $this->createItem('audio/ogg');