public function ChoiceFormFieldTest::testSelect in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/dom-crawler/Tests/Field/ChoiceFormFieldTest.php \Symfony\Component\DomCrawler\Tests\Field\ChoiceFormFieldTest::testSelect()
File
- vendor/
symfony/ dom-crawler/ Tests/ Field/ ChoiceFormFieldTest.php, line 303
Class
Namespace
Symfony\Component\DomCrawler\Tests\FieldCode
public function testSelect() {
$node = $this
->createNode('input', '', array(
'type' => 'checkbox',
'name' => 'name',
'checked' => 'checked',
));
$field = new ChoiceFormField($node);
$field
->select(true);
$this
->assertEquals('on', $field
->getValue(), '->select() changes the value of the field');
$field
->select(false);
$this
->assertNull($field
->getValue(), '->select() changes the value of the field');
$node = $this
->createSelectNode(array(
'foo' => false,
'bar' => false,
));
$field = new ChoiceFormField($node);
$field
->select('foo');
$this
->assertEquals('foo', $field
->getValue(), '->select() changes the selected option');
}