You are here

public function CrawlerTest::testSlice 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::testSlice()

File

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

Class

CrawlerTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function testSlice() {
  $crawler = $this
    ->createTestCrawler()
    ->filterXPath('//ul[1]/li');
  $this
    ->assertNotSame($crawler
    ->slice(), $crawler, '->slice() returns a new instance of a crawler');
  $this
    ->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler
    ->slice(), '->slice() returns a new instance of a crawler');
  $this
    ->assertCount(3, $crawler
    ->slice(), '->slice() does not slice the nodes in the list if any param is entered');
  $this
    ->assertCount(1, $crawler
    ->slice(1, 1), '->slice() slices the nodes in the list');
}