示例#1
0
 public function testGetStatuses()
 {
     $service = new Atom('http://localhost/feed.xml');
     $service->setClient($this->getClient(__DIR__ . '/Fixtures/Atom.xml'));
     $statuses = $service->getStatuses();
     $this->assertCount(5, $statuses);
     $firstStatus = $statuses[0];
     $this->assertEquals('Atom-Powered Robots Run Amok', $firstStatus->getText());
     $this->assertEquals('http://example.org/2003/12/13/atom03', $firstStatus->getUrl());
     $this->assertEquals('2003-12-13', $firstStatus->getDate()->format('Y-m-d'));
 }
示例#2
0
 /**
  * Constructor
  *
  * @param string $username The github username
  * @param Client $client   The client
  */
 public function __construct($username, Client $client = null)
 {
     $feedUrl = sprintf(self::FEED_URL, $username);
     $profileUrl = sprintf(self::PROFILE_URL, $username);
     parent::__construct($feedUrl, $profileUrl, $client);
 }