You are here

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

File

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

Class

CrawlerTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function testNextAll() {
  $crawler = $this
    ->createTestCrawler()
    ->filterXPath('//li')
    ->eq(1);
  $this
    ->assertNotSame($crawler, $crawler
    ->nextAll(), '->nextAll() returns a new instance of a crawler');
  $this
    ->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->nextAll() returns a new instance of a crawler');
  $nodes = $crawler
    ->nextAll();
  $this
    ->assertEquals(1, $nodes
    ->count());
  $this
    ->assertEquals('Three', $nodes
    ->eq(0)
    ->text());
  try {
    $this
      ->createTestCrawler()
      ->filterXPath('//ol')
      ->nextAll();
    $this
      ->fail('->nextAll() throws an \\InvalidArgumentException if the node list is empty');
  } catch (\InvalidArgumentException $e) {
    $this
      ->assertTrue(true, '->nextAll() throws an \\InvalidArgumentException if the node list is empty');
  }
}