public function testUnset() { $feed = Zend_Feed::importFile(dirname(__FILE__) . '/_files/TestAtomFeed.xml'); unset($feed['version']); $this->assertFalse(isset($feed['version']), 'Version should be unset'); $this->assertEquals('', $feed['version'], 'Version should be equal to the empty string'); $nsfeed = Zend_Feed::importFile(dirname(__FILE__) . '/_files/TestAtomFeedNamespaced.xml'); unset($nsfeed['version']); $this->assertFalse(isset($nsfeed['version']), 'Version should be unset'); $this->assertEquals('', $nsfeed['version'], 'Version should be equal to the empty string'); }
public function testContentEncodedNullIfEmpty() { $feed = Zend_Feed::importFile(dirname(__FILE__) . '/../_files/TestFeedEntryRssContentEncoded.xml'); $this->assertType('Zend_Feed_Rss', $feed); $feed->next(); $item = $feed->current(); $this->assertType('Zend_Feed_Entry_Rss', $item); $this->assertFalse(isset($item->content)); $this->assertNull($item->content()); // $this->assertNull($item->content); // always return DOMElement Object }
/** * @param string $filename */ public function __construct($id, $url, $filename) { $this->url = $url; $this->id = $id; $feed = Zend_Feed::importFile($filename); if ($feed instanceof Zend_Feed_Rss) { $this->processRss($feed); } else { if ($feed instanceof Zend_Feed_Atom) { $this->processAtom($feed); } else { throw new Zend_Exception("Error reading feed " . $filename); } } }
public function testCount() { $f = Zend_Feed::importFile(dirname(__FILE__) . '/_files/TestAtomFeed.xml'); $this->assertEquals($f->count(), 2, 'Feed count should be 2'); }
public function setUp() { $this->_feed = Zend_Feed::importFile(dirname(__FILE__) . '/_files/TestAtomFeed.xml'); $this->_nsfeed = Zend_Feed::importFile(dirname(__FILE__) . '/_files/TestAtomFeedNamespaced.xml'); }
/** * @issue ZF-5354 */ public function testGetsLinkWithEmptyOrMissingRelAsAlternateRel() { $feed = Zend_Feed::importFile(dirname(__FILE__) . '/_files/AtomHOnline.xml'); $entry = $feed->current(); $this->assertEquals('http://www.h-online.com/security/Google-acquires-reCAPTCHA--/news/114266/from/rss', $entry->link('alternate')); }