You are here

public function DocumentElementTest::testFindById 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::testFindById()

File

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

Class

DocumentElementTest

Namespace

Behat\Mink\Tests\Element

Code

public function testFindById() {
  $xpath = '//*[@id=some-item-2]';
  $this
    ->mockNamedFinder($xpath, array(
    array(
      'id2',
      'id3',
    ),
    array(),
  ), array(
    'id',
    'some-item-2',
  ));
  $this
    ->assertEquals('id2', $this->document
    ->findById('some-item-2'));
  $this
    ->assertEquals(null, $this->document
    ->findById('some-item-2'));
}