本文整理汇总了PHP中Zend_Feed::importFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Feed::importFile方法的具体用法?PHP Zend_Feed::importFile怎么用?PHP Zend_Feed::importFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Feed
的用法示例。
在下文中一共展示了Zend_Feed::importFile方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testUnset
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');
}
示例2: testContentEncodedNullIfEmpty
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
}
示例3: __construct
/**
* @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);
}
}
}
示例4: testCount
public function testCount()
{
$f = Zend_Feed::importFile(dirname(__FILE__) . '/_files/TestAtomFeed.xml');
$this->assertEquals($f->count(), 2, 'Feed count should be 2');
}
示例5: setUp
public function setUp()
{
$this->_feed = Zend_Feed::importFile(dirname(__FILE__) . '/_files/TestAtomFeed.xml');
$this->_nsfeed = Zend_Feed::importFile(dirname(__FILE__) . '/_files/TestAtomFeedNamespaced.xml');
}
示例6: testGetsLinkWithEmptyOrMissingRelAsAlternateRel
/**
* @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'));
}