From 91f302245e14f4d40f9daa83aaef3000753d71d8 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Thu, 30 Oct 2014 11:30:12 +0100 Subject: also set the feed location --- tests/unit/fetcher/FeedFetcherTest.php | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'tests/unit') 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'); -- cgit v1.2.3