summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Nassabain <marco.nassabain@hotmail.com>2021-03-16 23:02:50 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-03-17 08:58:42 +0100
commitb4aab693043b130cc13f97fd1a8566604b17be4f (patch)
tree4a12a76f6ac536da340faa104b6814eb41134ad3
parent226a7d0dfb8fdbcc399a4302df2fb48a4eafcfa9 (diff)
✅ FeedFetcher: update tests to include categories
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
-rw-r--r--tests/Unit/Fetcher/FeedFetcherTest.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/Unit/Fetcher/FeedFetcherTest.php b/tests/Unit/Fetcher/FeedFetcherTest.php
index ead4a67eb..534d48fc5 100644
--- a/tests/Unit/Fetcher/FeedFetcherTest.php
+++ b/tests/Unit/Fetcher/FeedFetcherTest.php
@@ -18,6 +18,7 @@ use Favicon\Favicon;
use FeedIo\Adapter\ResponseInterface;
use FeedIo\Feed\Item\Author;
use FeedIo\Feed\Item\MediaInterface;
+use FeedIo\Feed\Node\Category;
use FeedIo\Feed\ItemInterface;
use FeedIo\FeedInterface;
use FeedIo\FeedIo;
@@ -212,6 +213,11 @@ class FeedFetcherTest extends TestCase
$this->author->setName('&lt;boogieman');
$this->enclosure = 'http://enclosure.you';
+ $category = new Category();
+ $category->setLabel('food');
+ $this->categories = new \ArrayIterator([$category]);
+ $this->categoriesJson = json_encode(['food']);
+
$this->feed_title = '&lt;a&gt;&amp;its a&lt;/a&gt; title';
$this->feed_link = 'http://tests/';
$this->feed_image = '/an/image';
@@ -575,6 +581,9 @@ class FeedFetcherTest extends TestCase
$this->item_mock->expects($this->exactly(1))
->method('getAuthor')
->will($this->returnValue($this->author));
+ $this->item_mock->expects($this->exactly(1))
+ ->method('getCategories')
+ ->will($this->returnValue($this->categories));
$item = new Item();
@@ -587,7 +596,8 @@ class FeedFetcherTest extends TestCase
->setRtl(false)
->setLastModified(3)
->setPubDate(3)
- ->setAuthor(html_entity_decode($this->author->getName()));
+ ->setAuthor(html_entity_decode($this->author->getName()))
+ ->setCategoriesJson($this->categoriesJson);
if ($enclosureType === 'audio/ogg' || $enclosureType === 'video/ogg') {
$media = $this->getMockbuilder(MediaInterface::class)->getMock();