You are here

public function CrawlerTest::testFilter in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dom-crawler/Tests/CrawlerTest.php \Symfony\Component\DomCrawler\Tests\CrawlerTest::testFilter()

@covers Symfony\Component\DomCrawler\Crawler::filter

File

vendor/symfony/dom-crawler/Tests/CrawlerTest.php, line 601

Class

CrawlerTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function testFilter() {
  $crawler = $this
    ->createTestCrawler();
  $this
    ->assertNotSame($crawler, $crawler
    ->filter('li'), '->filter() returns a new instance of a crawler');
  $this
    ->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->filter() returns a new instance of a crawler');
  $crawler = $this
    ->createTestCrawler()
    ->filter('ul');
  $this
    ->assertCount(6, $crawler
    ->filter('li'), '->filter() filters the node list with the CSS selector');
}