You are here

public function WebAssertTest::testCheckboxChecked in Zircon Profile 8.0

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

File

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

Class

WebAssertTest

Namespace

Behat\Mink\Tests

Code

public function testCheckboxChecked() {
  $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('remember_me')
    ->will($this
    ->returnValue($element));
  $element
    ->expects($this
    ->exactly(2))
    ->method('isChecked')
    ->will($this
    ->onConsecutiveCalls(true, false));
  $this
    ->assertCorrectAssertion('checkboxChecked', array(
    'remember_me',
  ));
  $this
    ->assertWrongAssertion('checkboxChecked', array(
    'remember_me',
  ), 'Behat\\Mink\\Exception\\ExpectationException', 'Checkbox "remember_me" is not checked, but it should be.');
}