You are here

public function WebAssertTest::testElementExistsWithArrayLocator in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/behat/mink/tests/WebAssertTest.php \Behat\Mink\Tests\WebAssertTest::testElementExistsWithArrayLocator()

File

vendor/behat/mink/tests/WebAssertTest.php, line 619

Class

WebAssertTest

Namespace

Behat\Mink\Tests

Code

public function testElementExistsWithArrayLocator() {
  $container = $this
    ->getMockBuilder('Behat\\Mink\\Element\\NodeElement')
    ->disableOriginalConstructor()
    ->getMock();
  $this->session
    ->expects($this
    ->never())
    ->method('getPage');
  $container
    ->expects($this
    ->exactly(2))
    ->method('find')
    ->with('named', array(
    'element',
    'Test',
  ))
    ->will($this
    ->onConsecutiveCalls(1, null));
  $this
    ->assertCorrectAssertion('elementExists', array(
    'named',
    array(
      'element',
      'Test',
    ),
    $container,
  ));
  $this
    ->assertWrongAssertion('elementExists', array(
    'named',
    array(
      'element',
      'Test',
    ),
    $container,
  ), 'Behat\\Mink\\Exception\\ElementNotFoundException', 'Element with named "element Test" not found.');
}