You are here

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

File

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

Class

CrawlerTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function testFirst() {
  $crawler = $this
    ->createTestCrawler()
    ->filterXPath('//li');
  $this
    ->assertNotSame($crawler, $crawler
    ->first(), '->first() returns a new instance of a crawler');
  $this
    ->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->first() returns a new instance of a crawler');
  $this
    ->assertEquals('One', $crawler
    ->first()
    ->text());
}