public function testEntryOnly()
 {
     $feed = new Zend_Feed_Atom(null, file_get_contents(dirname(__FILE__) . '/_files/TestAtomFeedEntryOnly.xml'));
     $this->assertEquals(1, $feed->count(), 'The entry-only feed should report one entry.');
     foreach ($feed as $entry) {
     }
     $this->assertEquals('Zend_Feed_Entry_Atom', get_class($entry), 'The single entry should be an instance of Zend_Feed_Entry_Atom');
     $this->assertEquals('1', $entry->id(), 'The single entry should have id 1');
     $this->assertEquals('Bug', $entry->title(), 'The entry\'s title should be "Bug"');
 }
Exemplo n.º 2
0
 /**
  * @param Zend_Feed_Atom $atom
  */
 private function processAtom($atom)
 {
     $this->addField(Zend_Search_Lucene_Field::UnIndexed('id', $this->id));
     $this->addField(Zend_Search_Lucene_Field::UnIndexed('url', $this->url));
     $this->addField(Zend_Search_Lucene_Field::Text('title', $atom->title()));
     // Loop over each channel item and store relevant data
     $text = '';
     foreach ($atom as $item) {
         $text .= $item->title();
         $text .= ' ';
         $text .= $item->content();
     }
     $this->addField(Zend_Search_Lucene_Field::Text('body', $text));
 }