You are here

public function CheckboxTest::testManipulate in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/driver-testsuite/tests/Form/CheckboxTest.php \Behat\Mink\Tests\Driver\Form\CheckboxTest::testManipulate()

File

vendor/behat/mink/driver-testsuite/tests/Form/CheckboxTest.php, line 9

Class

CheckboxTest

Namespace

Behat\Mink\Tests\Driver\Form

Code

public function testManipulate() {
  $this
    ->getSession()
    ->visit($this
    ->pathTo('advanced_form.html'));
  $checkbox = $this
    ->getAssertSession()
    ->fieldExists('agreement');
  $this
    ->assertNull($checkbox
    ->getValue());
  $this
    ->assertFalse($checkbox
    ->isChecked());
  $checkbox
    ->check();
  $this
    ->assertEquals('yes', $checkbox
    ->getValue());
  $this
    ->assertTrue($checkbox
    ->isChecked());
  $checkbox
    ->uncheck();
  $this
    ->assertNull($checkbox
    ->getValue());
  $this
    ->assertFalse($checkbox
    ->isChecked());
}