public function ChoiceFormFieldTest::testDisableValidation 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::testDisableValidation()
File
- vendor/
symfony/ dom-crawler/ Tests/ Field/ ChoiceFormFieldTest.php, line 331
Class
Namespace
Symfony\Component\DomCrawler\Tests\FieldCode
public function testDisableValidation() {
$node = $this
->createSelectNode(array(
'foo' => false,
'bar' => false,
));
$field = new ChoiceFormField($node);
$field
->disableValidation();
$field
->setValue('foobar');
$this
->assertEquals('foobar', $field
->getValue(), '->disableValidation() allows to set a value which is not in the selected options.');
$node = $this
->createSelectNode(array(
'foo' => false,
'bar' => false,
), array(
'multiple' => 'multiple',
));
$field = new ChoiceFormField($node);
$field
->disableValidation();
$field
->setValue(array(
'foobar',
));
$this
->assertEquals(array(
'foobar',
), $field
->getValue(), '->disableValidation() allows to set a value which is not in the selected options.');
}