You are here

public function CheckboxTest::testCheckboxMultiple 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::testCheckboxMultiple()

File

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

Class

CheckboxTest

Namespace

Behat\Mink\Tests\Driver\Form

Code

public function testCheckboxMultiple() {
  $this
    ->getSession()
    ->visit($this
    ->pathTo('/multicheckbox_form.html'));
  $webAssert = $this
    ->getAssertSession();
  $this
    ->assertEquals('Multicheckbox Test', $webAssert
    ->elementExists('css', 'h1')
    ->getText());
  $updateMail = $webAssert
    ->elementExists('css', '[name="mail_types[]"][value="update"]');
  $spamMail = $webAssert
    ->elementExists('css', '[name="mail_types[]"][value="spam"]');
  $this
    ->assertEquals('update', $updateMail
    ->getValue());
  $this
    ->assertNull($spamMail
    ->getValue());
  $this
    ->assertTrue($updateMail
    ->isChecked());
  $this
    ->assertFalse($spamMail
    ->isChecked());
  $updateMail
    ->uncheck();
  $this
    ->assertFalse($updateMail
    ->isChecked());
  $this
    ->assertFalse($spamMail
    ->isChecked());
  $spamMail
    ->check();
  $this
    ->assertFalse($updateMail
    ->isChecked());
  $this
    ->assertTrue($spamMail
    ->isChecked());
}