You are here

public function DocumentElementTest::testFindAll in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/tests/Element/DocumentElementTest.php \Behat\Mink\Tests\Element\DocumentElementTest::testFindAll()

File

vendor/behat/mink/tests/Element/DocumentElementTest.php, line 30

Class

DocumentElementTest

Namespace

Behat\Mink\Tests\Element

Code

public function testFindAll() {
  $xpath = 'h3[a]';
  $css = 'h3 > a';
  $this->driver
    ->expects($this
    ->exactly(2))
    ->method('find')
    ->will($this
    ->returnValueMap(array(
    array(
      '//html/' . $xpath,
      array(
        2,
        3,
        4,
      ),
    ),
    array(
      '//html/' . $css,
      array(
        1,
        2,
      ),
    ),
  )));
  $this->selectors
    ->expects($this
    ->exactly(2))
    ->method('selectorToXpath')
    ->will($this
    ->returnValueMap(array(
    array(
      'xpath',
      $xpath,
      $xpath,
    ),
    array(
      'css',
      $css,
      $css,
    ),
  )));
  $this
    ->assertEquals(3, count($this->document
    ->findAll('xpath', $xpath)));
  $this
    ->assertEquals(2, count($this->document
    ->findAll('css', $css)));
}