Ejemplo n.º 1
0
 public function testGetStatuses()
 {
     $service = new Rss('http://localhost/feed.xml');
     $service->setClient($this->getClient(__DIR__ . '/Fixtures/Rss20.xml'));
     $statuses = $service->getStatuses();
     $this->assertCount(5, $statuses);
     $firstStatus = $statuses[0];
     $this->assertEquals('Actualite N1', $firstStatus->getText());
     $this->assertEquals(array('description' => 'Ceci est ma premiere actualite', 'categories' => array()), $firstStatus->getExtra());
     $this->assertEquals('2002-09-07', $firstStatus->getDate()->format('Y-m-d'));
 }
Ejemplo n.º 2
0
 /**
  * Constructor
  *
  * @param string $userId   The flickr user id
  * @param string $username The flickr username
  * @param Client $client   A client
  */
 public function __construct($userId, $username, Client $client = null)
 {
     $feedUrl = sprintf(self::FEED_URL, $userId, $username);
     $profileUrl = sprintf(self::PROFILE_URL, $username);
     parent::__construct($feedUrl, $profileUrl, $client);
 }