Skip to content

Commit 9bd210c

Browse files
author
Harrison Ifeanyichukwu
committed
test: test that feeds and feed items correctly returns ParameterBags where neccessary
1 parent 98a152b commit 9bd210c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/ParserTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Forensic\FeedParser\Feeds\ATOMFeed;
1414
use Forensic\FeedParser\Feeds\RSSFeed;
1515
use Forensic\FeedParser\Feeds\RDFFeed;
16+
use Forensic\FeedParser\ParameterBag;
1617

1718
class ParserTest extends TestCase
1819
{
@@ -174,4 +175,23 @@ public function testFeedItemNonExistingPropertyAccessibility()
174175
);
175176
$this->assertNull($feed->items[0]->random);
176177
}
178+
179+
/**
180+
* test if feed returns paramater bag for array properties such as image
181+
*/
182+
public function testIfFeedReturnsParameterBag()
183+
{
184+
$feed = $this->_parser->parseFromFile(__DIR__ . '/Helpers/Feeds/rss.xml');
185+
$this->assertInstanceOf(ParameterBag::class, $feed->image);
186+
}
187+
188+
/**
189+
* test if feed item returns paramater bag for array properties such as image
190+
* and enclosure
191+
*/
192+
public function testIfFeedItemReturnsParameterBag()
193+
{
194+
$feed = $this->_parser->parseFromFile(__DIR__ . '/Helpers/Feeds/rss.xml');
195+
$this->assertInstanceOf(ParameterBag::class, $feed->items[0]->enclosure);
196+
}
177197
}

0 commit comments

Comments
 (0)