download(); $this->assertTrue($grabber->parse()); $grabber = new Grabber('http://www.lemonde.fr/proche-orient/article/2013/08/30/la-france-nouvelle-plus-ancienne-alliee-des-etats-unis_3469218_3218.html'); $grabber->download(); $this->assertTrue($grabber->parse()); $grabber = new Grabber('http://www.rue89.com/2013/08/30/faisait-boris-boillon-ex-sarko-boy-350-000-euros-gare-nord-245315'); $grabber->download(); $this->assertTrue($grabber->parse()); $grabber = new Grabber('http://www.inc.com/suzanne-lucas/why-employee-turnover-is-so-costly.html'); $grabber->download(); $this->assertTrue($grabber->parse()); $grabber = new Grabber('http://arstechnica.com/information-technology/2013/08/sysadmin-security-fail-nsa-finds-snowden-hijacked-officials-logins/'); $grabber->download(); $this->assertTrue($grabber->parse()); } public function testGetRules() { $grabber = new Grabber('http://www.egscomics.com/index.php?id=1690'); $this->assertTrue(is_array($grabber->getRules())); } public function testGrabContent() { $grabber = new Grabber('http://www.egscomics.com/index.php?id=1690'); $grabber->download(); $this->assertTrue($grabber->parse()); $this->assertEquals('', $grabber->getContent()); } public function testRssGrabContent() { $reader = new Reader; $client = $reader->download('http://www.egscomics.com/rss.php'); $parser = $reader->getParser($client->getUrl(), $client->getContent(), $client->getEncoding()); $parser->enableContentGrabber(); $feed = $parser->execute(); $this->assertTrue(is_array($feed->items)); $this->assertTrue(strpos($feed->items[0]->content, '= 0); } }