/**
  * {@inheritDoc}
  */
 public function getSubtitle()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getSubtitle', array());
     return parent::getSubtitle();
 }
Пример #2
0
 public function checkRSSRootNode(\DOMXPath $xpath, Feed $feed)
 {
     $channel = $xpath->query("/rss/channel");
     foreach ($channel->item(0)->childNodes as $child) {
         if ($child->nodeType !== XML_TEXT_NODE) {
             switch ($child->nodeName) {
                 case 'title':
                     $this->assertEquals($feed->getTitle(), $child->nodeValue);
                     break;
                 case 'dc:title':
                     $this->assertEquals($feed->getTitle(), $child->nodeValue);
                     break;
                 case 'description':
                     $this->assertEquals($feed->getSubtitle(), $child->nodeValue);
                     break;
                 case 'link':
                     $this->assertEquals(self::$DI['app']['feed.user-link-generator']->generatePublic($feed, 'rss', 1)->getURI(), $child->nodeValue);
                     break;
                 case 'pubDate':
                     $this->assertTrue(new \DateTime() >= new \DateTime($child->nodeValue));
                     break;
                 case 'generator':
                     $this->assertEquals("Phraseanet", $child->nodeValue);
                     break;
                 case 'docs':
                     $this->assertEquals("http://blogs.law.harvard.edu/tech/rss", $child->nodeValue);
                     break;
                 case 'atom:link':
                     foreach ($child->attributes as $attribute) {
                         if ($attribute->name == "href") {
                             $this->assertEquals(self::$DI['app']['feed.user-link-generator']->generatePublic($feed, 'rss', 1)->getURI(), $attribute->value);
                             break;
                         }
                     }
                     break;
             }
         }
     }
 }
Пример #3
0
 /**
  * Retrieve detailled informations about one feed
  *
  * @param  Feed $feed
  * @param  type $user
  *
  * @return array
  */
 private function list_publication(Feed $feed, $user)
 {
     return ['id' => $feed->getId(), 'title' => $feed->getTitle(), 'subtitle' => $feed->getSubtitle(), 'total_entries' => $feed->getCountTotalEntries(), 'icon' => $feed->getIconUrl(), 'public' => $feed->isPublic(), 'readonly' => !$feed->isPublisher($user), 'deletable' => $feed->isOwner($user), 'created_on' => $feed->getCreatedOn()->format(DATE_ATOM), 'updated_on' => $feed->getUpdatedOn()->format(DATE_ATOM)];
 }