You are here

public function ChoiceFormFieldTest::testCheckboxWithEmptyBooleanAttribute in Zircon Profile 8.0

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

File

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

Class

ChoiceFormFieldTest

Namespace

Symfony\Component\DomCrawler\Tests\Field

Code

public function testCheckboxWithEmptyBooleanAttribute() {
  $node = $this
    ->createNode('input', '', array(
    'type' => 'checkbox',
    'name' => 'name',
    'value' => 'foo',
    'checked' => '',
  ));
  $field = new ChoiceFormField($node);
  $this
    ->assertTrue($field
    ->hasValue(), '->hasValue() returns true when the checkbox is checked');
  $this
    ->assertEquals('foo', $field
    ->getValue());
}