You are here

public function WebAssertTest::testFieldNotExists in Zircon Profile 8

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

File

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

Class

WebAssertTest

Namespace

Behat\Mink\Tests

Code

public function testFieldNotExists() {
  $page = $this
    ->getMockBuilder('Behat\\Mink\\Element\\DocumentElement')
    ->disableOriginalConstructor()
    ->getMock();
  $element = $this
    ->getMockBuilder('Behat\\Mink\\Element\\NodeElement')
    ->disableOriginalConstructor()
    ->getMock();
  $this->session
    ->expects($this
    ->exactly(2))
    ->method('getPage')
    ->will($this
    ->returnValue($page));
  $page
    ->expects($this
    ->exactly(2))
    ->method('findField')
    ->with('username')
    ->will($this
    ->onConsecutiveCalls(null, $element));
  $this
    ->assertCorrectAssertion('fieldNotExists', array(
    'username',
  ));
  $this
    ->assertWrongAssertion('fieldNotExists', array(
    'username',
  ), 'Behat\\Mink\\Exception\\ExpectationException', 'A field "username" appears on this page, but it should not.');
}