Example #1
0
 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');
 }
Example #2
0
 public function testClear()
 {
     $crawler = new Crawler(new \DOMNode());
     $crawler->clear();
     $this->assertEquals(0, count($crawler), '->clear() removes all the nodes from the crawler');
 }