/tests/ZendTest/Feed/Reader/Entry/RssTest.php
https://github.com/zucchi/zf2 · PHP · 1495 lines · 1276 code · 173 blank · 46 comment · 0 complexity · dcd76a966f27b8f5e04d8d07c81519d9 MD5 · raw file
- <?php
- /**
- * Zend Framework (http://framework.zend.com/)
- *
- * @link http://github.com/zendframework/zf2 for the canonical source repository
- * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @package Zend_Feed
- */
- namespace ZendTest\Feed\Reader\Entry;
- use DateTime;
- use Zend\Feed\Reader;
- /**
- * @category Zend
- * @package Zend_Feed
- * @subpackage UnitTests
- * @group Zend_Feed
- * @group Zend_Feed_Reader
- */
- class RssTest extends \PHPUnit_Framework_TestCase
- {
- protected $feedSamplePath = null;
- protected $expectedCats = array();
- protected $expectedCatsRdf = array();
- protected $expectedCatsAtom = array();
- public function setup()
- {
- Reader\Reader::reset();
- $this->feedSamplePath = dirname(__FILE__) . '/_files/Rss';
- $this->expectedCats = array(
- array(
- 'term' => 'topic1',
- 'scheme' => 'http://example.com/schema1',
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'topic1',
- 'scheme' => 'http://example.com/schema2',
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'topic2',
- 'scheme' => 'http://example.com/schema1',
- 'label' => 'topic2'
- )
- );
- $this->expectedCatsRdf = array(
- array(
- 'term' => 'topic1',
- 'scheme' => null,
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'topic2',
- 'scheme' => null,
- 'label' => 'topic2'
- )
- );
- $this->expectedCatsAtom = array(
- array(
- 'term' => 'topic1',
- 'scheme' => 'http://example.com/schema1',
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'topic1',
- 'scheme' => 'http://example.com/schema2',
- 'label' => 'topic1'
- ),
- array(
- 'term' => 'cat_dog',
- 'scheme' => 'http://example.com/schema1',
- 'label' => 'Cat & Dog'
- )
- );
- }
- /**
- * Get Id (Unencoded Text)
- */
- public function testGetsIdFromRss20()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.example.com/1', $entry->getId());
- }
- public function testGetsIdFromRss094()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getId());
- }
- public function testGetsIdFromRss093()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getId());
- }
- public function testGetsIdFromRss092()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getId());
- }
- public function testGetsIdFromRss091()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getId());
- }
- public function testGetsIdFromRss10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getId());
- }
- public function testGetsIdFromRss090()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getId());
- }
- // DC 1.0
- public function testGetsIdFromRss20_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/dc10/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.example.com/1', $entry->getId());
- }
- public function testGetsIdFromRss094_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/dc10/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.example.com/1', $entry->getId());
- }
- public function testGetsIdFromRss093_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/dc10/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.example.com/1', $entry->getId());
- }
- public function testGetsIdFromRss092_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/dc10/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.example.com/1', $entry->getId());
- }
- public function testGetsIdFromRss091_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/dc10/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.example.com/1', $entry->getId());
- }
- public function testGetsIdFromRss10_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/dc10/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.example.com/1', $entry->getId());
- }
- public function testGetsIdFromRss090_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/dc10/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.example.com/1', $entry->getId());
- }
- // DC 1.1
- public function testGetsIdFromRss20_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/dc11/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.example.com/1', $entry->getId());
- }
- public function testGetsIdFromRss094_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/dc11/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.example.com/1', $entry->getId());
- }
- public function testGetsIdFromRss093_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/dc11/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.example.com/1', $entry->getId());
- }
- public function testGetsIdFromRss092_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/dc11/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.example.com/1', $entry->getId());
- }
- public function testGetsIdFromRss091_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/dc11/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.example.com/1', $entry->getId());
- }
- public function testGetsIdFromRss10_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/dc11/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.example.com/1', $entry->getId());
- }
- public function testGetsIdFromRss090_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/dc11/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('http://www.example.com/1', $entry->getId());
- }
- // Missing Id (but alternates to Title)
- public function testGetsIdFromRss20_Title()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/title/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getId());
- }
- public function testGetsIdFromRss094_Title()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/title/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getId());
- }
- public function testGetsIdFromRss093_Title()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/title/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getId());
- }
- public function testGetsIdFromRss092_Title()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/title/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getId());
- }
- public function testGetsIdFromRss091_Title()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/title/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getId());
- }
- public function testGetsIdFromRss10_Title()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/title/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getId());
- }
- public function testGetsIdFromRss090_Title()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/title/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getId());
- }
- // Missing Any Id
- public function testGetsIdFromRss20_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/none/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getId());
- }
- public function testGetsIdFromRss094_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/none/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getId());
- }
- public function testGetsIdFromRss093_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/none/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getId());
- }
- public function testGetsIdFromRss092_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/none/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getId());
- }
- public function testGetsIdFromRss091_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/none/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getId());
- }
- public function testGetsIdFromRss10_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/none/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getId());
- }
- public function testGetsIdFromRss090_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/id/plain/none/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getId());
- }
- /**
- * Get Title (Unencoded Text)
- */
- public function testGetsTitleFromRss20()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss094()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss093()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss092()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss091()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss090()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- // DC 1.0
- public function testGetsTitleFromRss20_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss094_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss093_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss092_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss091_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss10_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss090_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/dc10/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- // DC 1.1
- public function testGetsTitleFromRss20_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss094_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss093_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss092_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss091_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss10_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- public function testGetsTitleFromRss090_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/dc11/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Title', $entry->getTitle());
- }
- // Missing Title
- public function testGetsTitleFromRss20_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/none/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getTitle());
- }
- public function testGetsTitleFromRss094_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/none/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getTitle());
- }
- public function testGetsTitleFromRss093_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/none/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getTitle());
- }
- public function testGetsTitleFromRss092_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/none/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getTitle());
- }
- public function testGetsTitleFromRss091_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/none/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getTitle());
- }
- public function testGetsTitleFromRss10_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/none/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getTitle());
- }
- public function testGetsTitleFromRss090_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/title/plain/none/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getTitle());
- }
- /**
- * Get Authors (Unencoded Text)
- */
- public function testGetsAuthorsFromRss20()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array(
- array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
- array('email'=>'jane@example.com','name'=>'Jane Bloggs')
- ), (array) $entry->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
- }
- public function testGetsAuthorsFromRss094()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthors());
- }
- public function testGetsAuthorsFromRss093()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthors());
- }
- public function testGetsAuthorsFromRss092()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthors());
- }
- public function testGetsAuthorsFromRss091()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthors());
- }
- public function testGetsAuthorsFromRss10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthors());
- }
- public function testGetsAuthorsFromRss090()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthors());
- }
- // DC 1.0
- public function testGetsAuthorsFromRss20_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $entry->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
- }
- public function testGetsAuthorsFromRss094_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $entry->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
- }
- public function testGetsAuthorsFromRss093_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $entry->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
- }
- public function testGetsAuthorsFromRss092_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $entry->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
- }
- public function testGetsAuthorsFromRss091_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $entry->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
- }
- public function testGetsAuthorsFromRss10_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $entry->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
- }
- public function testGetsAuthorsFromRss090_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $entry->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
- }
- // DC 1.1
- public function testGetsAuthorsFromRss20_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $entry->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
- }
- public function testGetsAuthorsFromRss094_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $entry->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
- }
- public function testGetsAuthorsFromRss093_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $entry->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
- }
- public function testGetsAuthorsFromRss092_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $entry->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
- }
- public function testGetsAuthorsFromRss091_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $entry->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
- }
- public function testGetsAuthorsFromRss10_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $entry->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
- }
- public function testGetsAuthorsFromRss090_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array(
- array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
- ), (array) $entry->getAuthors());
- $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
- }
- // Missing Author
- public function testGetsAuthorsFromRss20_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/none/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthors());
- }
- public function testGetsAuthorsFromRss094_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/none/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthors());
- }
- public function testGetsAuthorsFromRss093_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/none/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthors());
- }
- public function testGetsAuthorsFromRss092_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/none/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthors());
- }
- public function testGetsAuthorsFromRss091_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/none/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthors());
- }
- public function testGetsAuthorsFromRss10_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/none/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthors());
- }
- public function testGetsAuthorsFromRss090_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/none/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthors());
- }
- /**
- * Get Author (Unencoded Text)
- */
- public function testGetsAuthorFromRss20()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $entry->getAuthor());
- }
- public function testGetsAuthorFromRss094()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthor());
- }
- public function testGetsAuthorFromRss093()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthor());
- }
- public function testGetsAuthorFromRss092()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthor());
- }
- public function testGetsAuthorFromRss091()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthor());
- }
- public function testGetsAuthorFromRss10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthor());
- }
- public function testGetsAuthorFromRss090()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthor());
- }
- // DC 1.0
- public function testGetsAuthorFromRss20_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
- }
- public function testGetsAuthorFromRss094_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
- }
- public function testGetsAuthorFromRss093_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
- }
- public function testGetsAuthorFromRss092_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
- }
- public function testGetsAuthorFromRss091_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
- }
- public function testGetsAuthorFromRss10_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
- }
- public function testGetsAuthorFromRss090_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc10/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
- }
- // DC 1.1
- public function testGetsAuthorFromRss20_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
- }
- public function testGetsAuthorFromRss094_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
- }
- public function testGetsAuthorFromRss093_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
- }
- public function testGetsAuthorFromRss092_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
- }
- public function testGetsAuthorFromRss091_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
- }
- public function testGetsAuthorFromRss10_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
- }
- public function testGetsAuthorFromRss090_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/dc11/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
- }
- // Missing Id
- public function testGetsAuthorFromRss20_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/none/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthor());
- }
- public function testGetsAuthorFromRss094_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/none/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthor());
- }
- public function testGetsAuthorFromRss093_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/none/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthor());
- }
- public function testGetsAuthorFromRss092_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/none/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthor());
- }
- public function testGetsAuthorFromRss091_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/none/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthor());
- }
- public function testGetsAuthorFromRss10_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/none/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthor());
- }
- public function testGetsAuthorFromRss090_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/author/plain/none/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getAuthor());
- }
- /**
- * Get Description (Unencoded Text)
- */
- public function testGetsDescriptionFromRss20()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss094()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss093()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss092()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss091()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss090()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- // DC 1.0
- public function testGetsDescriptionFromRss20_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss094_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss093_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss092_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss091_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss10_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss090_Dc10()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/dc10/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- // DC 1.1
- public function testGetsDescriptionFromRss20_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss094_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss093_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss092_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss091_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss10_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- public function testGetsDescriptionFromRss090_Dc11()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/dc11/rss090.xml')
- );
- $entry = $feed->current();
- $this->assertEquals('Entry Description', $entry->getDescription());
- }
- // Missing Description
- public function testGetsDescriptionFromRss20_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/none/rss20.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getDescription());
- }
- public function testGetsDescriptionFromRss094_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/none/rss094.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getDescription());
- }
- public function testGetsDescriptionFromRss093_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/none/rss093.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getDescription());
- }
- public function testGetsDescriptionFromRss092_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/none/rss092.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getDescription());
- }
- public function testGetsDescriptionFromRss091_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/none/rss091.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getDescription());
- }
- public function testGetsDescriptionFromRss10_None()
- {
- $feed = Reader\Reader::importString(
- file_get_contents($this->feedSamplePath.'/description/plain/none/rss10.xml')
- );
- $entry = $feed->current();
- $this->assertEquals(null, $entry->getDescription());
- }
- public function testGetsDescriptionFrom