當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Feed::importFile方法代碼示例

本文整理匯總了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');
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:11,代碼來源:ArrayAccessTest.php

示例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
 }
開發者ID:ramyarangan,項目名稱:CS50Organizations,代碼行數:11,代碼來源:RssTest.php

示例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);
         }
     }
 }
開發者ID:BGCX261,項目名稱:zportal-svn-to-git,代碼行數:18,代碼來源:Rss.php

示例4: testCount

 public function testCount()
 {
     $f = Zend_Feed::importFile(dirname(__FILE__) . '/_files/TestAtomFeed.xml');
     $this->assertEquals($f->count(), 2, 'Feed count should be 2');
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:5,代碼來源:CountTest.php

示例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');
 }
開發者ID:sasezaki,項目名稱:mirror-zf1-tests,代碼行數:5,代碼來源:IteratorTest.php

示例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'));
 }
開發者ID:travisj,項目名稱:zf,代碼行數:9,代碼來源:ArrayAccessTest.php


注:本文中的Zend_Feed::importFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。