You are here

public function ChoiceFormFieldTest::testRadioButtonsWithEmptyBooleanAttribute in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dom-crawler/Tests/Field/ChoiceFormFieldTest.php \Symfony\Component\DomCrawler\Tests\Field\ChoiceFormFieldTest::testRadioButtonsWithEmptyBooleanAttribute()

File

vendor/symfony/dom-crawler/Tests/Field/ChoiceFormFieldTest.php, line 182

Class

ChoiceFormFieldTest

Namespace

Symfony\Component\DomCrawler\Tests\Field

Code

public function testRadioButtonsWithEmptyBooleanAttribute() {
  $node = $this
    ->createNode('input', '', array(
    'type' => 'radio',
    'name' => 'name',
    'value' => 'foo',
  ));
  $field = new ChoiceFormField($node);
  $node = $this
    ->createNode('input', '', array(
    'type' => 'radio',
    'name' => 'name',
    'value' => 'bar',
    'checked' => '',
  ));
  $field
    ->addChoice($node);
  $this
    ->assertTrue($field
    ->hasValue(), '->hasValue() returns true when a radio button is selected');
  $this
    ->assertEquals('bar', $field
    ->getValue(), '->getValue() returns the value attribute of the selected radio button');
}