You are here

public function Html5Test::testHtml5FormRadioAttribute in Zircon Profile 8

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

File

vendor/behat/mink/driver-testsuite/tests/Form/Html5Test.php, line 36

Class

Html5Test

Namespace

Behat\Mink\Tests\Driver\Form

Code

public function testHtml5FormRadioAttribute() {
  $this
    ->getSession()
    ->visit($this
    ->pathTo('html5_radio.html'));
  $page = $this
    ->getSession()
    ->getPage();
  $radio = $this
    ->findById('sex_f');
  $otherRadio = $this
    ->findById('sex_invalid');
  $this
    ->assertEquals('f', $radio
    ->getValue());
  $this
    ->assertEquals('invalid', $otherRadio
    ->getValue());
  $radio
    ->selectOption('m');
  $this
    ->assertEquals('m', $radio
    ->getValue());
  $this
    ->assertEquals('invalid', $otherRadio
    ->getValue());
  $page
    ->pressButton('Submit in form');
  $out = <<<OUT
  'sex' = 'm',
OUT;
  $this
    ->assertContains($out, $page
    ->getContent());
}