You are here

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

File

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

Class

CrawlerTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function testEq() {
  $crawler = $this
    ->createTestCrawler()
    ->filterXPath('//li');
  $this
    ->assertNotSame($crawler, $crawler
    ->eq(0), '->eq() returns a new instance of a crawler');
  $this
    ->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->eq() returns a new instance of a crawler');
  $this
    ->assertEquals('Two', $crawler
    ->eq(1)
    ->text(), '->eq() returns the nth node of the list');
  $this
    ->assertCount(0, $crawler
    ->eq(100), '->eq() returns an empty crawler if the nth node does not exist');
}