示例#1
0
 public function testFeedSetDateCreated()
 {
     $this->validWriter->setDateCreated(1234567890);
     $rssFeed = new Renderer\Feed\Rss($this->validWriter);
     $rssFeed->render();
     $feed = Reader\Reader::importString($rssFeed->saveXml());
     $myDate = new DateTime('@' . 1234567890);
     $this->assertEquals($myDate, $feed->getDateCreated());
 }
示例#2
0
 /**
  * @group ZFWCHARDATA01
  */
 public function testCategoriesCharDataEncoding()
 {
     $this->_validEntry->addCategories(array(array('term' => '<>&\'"áéíóú', 'label' => 'Cats & Dogs', 'scheme' => 'http://example.com/schema1'), array('term' => 'cat_dog2')));
     $renderer = new Renderer\Feed\Rss($this->_validWriter);
     $feed = Reader\Reader::importString($renderer->render()->saveXml());
     $entry = $feed->current();
     $expected = array(array('term' => '<>&\'"áéíóú', 'label' => '<>&\'"áéíóú', 'scheme' => 'http://example.com/schema1'), array('term' => 'cat_dog2', 'label' => 'cat_dog2', 'scheme' => null));
     $this->assertEquals($expected, (array) $entry->getCategories());
 }
示例#3
0
 /**
  * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface
  */
 public function testImageThrowsExceptionIfOptionalWidthGreaterThan144()
 {
     $this->_validWriter->setImage(array('uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', 'title' => 'Image ALT', 'height' => '400', 'width' => '145'));
     $rssFeed = new Renderer\Feed\Rss($this->_validWriter);
     $rssFeed->render();
 }