diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-21 13:53:22 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-21 13:53:22 +0200 |
commit | 1140199677f93a3958a0a19271d0f853d9330c30 (patch) | |
tree | f872dd8246e31b0c8e10d1e3609bf7c22a182151 /tests/unit/utility/FeedFetcherTest.php | |
parent | 6b64036662a8d2cad397f524532f68a51d41d773 (diff) |
if feed has no title, use its url, fix #108
Diffstat (limited to 'tests/unit/utility/FeedFetcherTest.php')
-rw-r--r-- | tests/unit/utility/FeedFetcherTest.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/unit/utility/FeedFetcherTest.php b/tests/unit/utility/FeedFetcherTest.php index 30881ae0d..3d1f2a340 100644 --- a/tests/unit/utility/FeedFetcherTest.php +++ b/tests/unit/utility/FeedFetcherTest.php @@ -244,6 +244,28 @@ class FeedFetcherTest extends \OCA\AppFramework\Utility\TestUtility { } + public function testFetchMapItemsNoFeedTitleUsesUrl(){ + $this->expectCore('get_title', ''); + $this->expectCore('get_link', $this->feedLink); + + $feed = new Feed(); + $feed->setTitle($this->url); + $feed->setUrl($this->url); + $feed->setLink($this->feedLink); + $feed->setUrlHash(md5($this->url)); + $feed->setAdded($this->time); + $feed->setFaviconLink(null); + + $this->core->expects($this->once()) + ->method('init') + ->will($this->returnValue(true)); + $item = $this->createItem(); + $this->expectCore('get_items', array($this->item)); + $result = $this->fetcher->fetch($this->url); + + $this->assertEquals(array($feed, array($item)), $result); + } + public function testFetchMapItemsAuthorExists(){ $this->core->expects($this->once()) ->method('init') |