You are here

public function NodeElementTest::testFindAllUnion in Zircon Profile 8

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

File

vendor/behat/mink/tests/Element/NodeElementTest.php, line 553

Class

NodeElementTest

Namespace

Behat\Mink\Tests\Element

Code

public function testFindAllUnion() {
  $node = new NodeElement('some_xpath', $this->session);
  $xpath = "some_tag1 | some_tag2[@foo =\n 'bar|'']\n | some_tag3[foo | bar]";
  $expected = "some_xpath/some_tag1 | some_xpath/some_tag2[@foo =\n 'bar|''] | some_xpath/some_tag3[foo | bar]";
  $this->driver
    ->expects($this
    ->exactly(1))
    ->method('find')
    ->will($this
    ->returnValueMap(array(
    array(
      $expected,
      array(
        2,
        3,
        4,
      ),
    ),
  )));
  $this->selectors
    ->expects($this
    ->exactly(1))
    ->method('selectorToXpath')
    ->will($this
    ->returnValueMap(array(
    array(
      'xpath',
      $xpath,
      $xpath,
    ),
  )));
  $this
    ->assertEquals(3, count($node
    ->findAll('xpath', $xpath)));
}