public function ChoiceFormFieldTest::testUntick in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/dom-crawler/Tests/Field/ChoiceFormFieldTest.php \Symfony\Component\DomCrawler\Tests\Field\ChoiceFormFieldTest::testUntick()
File
- vendor/
symfony/ dom-crawler/ Tests/ Field/ ChoiceFormFieldTest.php, line 285
Class
Namespace
Symfony\Component\DomCrawler\Tests\FieldCode
public function testUntick() {
$node = $this
->createSelectNode(array(
'foo' => false,
'bar' => false,
));
$field = new ChoiceFormField($node);
try {
$field
->untick();
$this
->fail('->untick() throws a \\LogicException for select boxes');
} catch (\LogicException $e) {
$this
->assertTrue(true, '->untick() throws a \\LogicException for select boxes');
}
$node = $this
->createNode('input', '', array(
'type' => 'checkbox',
'name' => 'name',
'checked' => 'checked',
));
$field = new ChoiceFormField($node);
$field
->untick();
$this
->assertNull($field
->getValue(), '->untick() unticks checkboxes');
}