factory() public static method

Static method to instantiate the data object and return itself to facilitate chaining methods together.
public static factory ( AbstractFormat $adapter ) : Reader
$adapter Pop\Feed\Format\AbstractFormat
return Reader
Exemplo n.º 1
0
 public function testConstructor()
 {
     $this->assertInstanceOf('Pop\\Feed\\Reader', new Feed\Reader(new Feed\Format\Rss('http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&topic=h&output=rss', 4)));
     $this->assertInstanceOf('Pop\\Feed\\Reader', Feed\Reader::factory(new Feed\Format\Rss('http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&topic=h&output=rss', 4)));
     $this->assertInstanceOf('Pop\\Feed\\Reader', Feed\Reader::getByUrl('http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&topic=h&output=rss', 4));
     $this->assertInstanceOf('Pop\\Feed\\Reader', Feed\Reader::getByUrl('http://twitter.com/highvoltagenola', 4));
     $this->assertInstanceOf('Pop\\Feed\\Reader', Feed\Reader::getByUrl('http://vimeo.com/api/v2/video/6271487.php', 1));
     $this->assertInstanceOf('Pop\\Feed\\Reader', Feed\Reader::getByUrl('http://www.popphp.org/phpfeedtest', 1));
 }