You are here

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

File

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

Class

DocumentElementTest

Namespace

Behat\Mink\Tests\Element

Code

public function testHasUncheckedField() {
  $checkbox = $this
    ->getMockBuilder('Behat\\Mink\\Element\\NodeElement')
    ->disableOriginalConstructor()
    ->getMock();
  $checkbox
    ->expects($this
    ->exactly(2))
    ->method('isChecked')
    ->will($this
    ->onConsecutiveCalls(true, false));
  $this
    ->mockNamedFinder('//field', array(
    array(
      $checkbox,
    ),
    array(),
    array(
      $checkbox,
    ),
  ), array(
    'field',
    'some checkbox',
  ), 3);
  $this
    ->assertFalse($this->document
    ->hasUncheckedField('some checkbox'));
  $this
    ->assertFalse($this->document
    ->hasUncheckedField('some checkbox'));
  $this
    ->assertTrue($this->document
    ->hasUncheckedField('some checkbox'));
}