コード例 #1
0
ファイル: Client.php プロジェクト: khalid05/symfony
 protected function createCrawlerFromContent($uri, $content, $type)
 {
     $crawler = new Crawler(null, $uri);
     $crawler->addContent($content, $type);
     return $crawler;
 }
コード例 #2
0
ファイル: CrawlerTest.php プロジェクト: robo47/symfony
 public function testIsEmpty()
 {
     $crawler = new Crawler(new \DOMNode());
     $this->assertFalse($crawler->isEmpty(), '->isEmpty() returns false if the crawler node list is not empty');
     $crawler->clear();
     $this->assertTrue($crawler->isEmpty(), '->isEmpty() returns true if the crawler node list is empty');
 }
コード例 #3
0
ファイル: CrawlerTest.php プロジェクト: bill97420/symfony
 public function testClear()
 {
     $crawler = new Crawler(new \DOMNode());
     $crawler->clear();
     $this->assertEquals(0, count($crawler), '->clear() removes all the nodes from the crawler');
 }