namespace Symfony\Component\DomCrawler\Tests\Field;
use Symfony\Component\DomCrawler\Field\ChoiceFormField;
class ChoiceFormFieldTest extends FormFieldTestCase
{ public function testInitialize() { $node =
$this->
createNode('textarea', ''
);
try { new ChoiceFormField($node);
$this->
fail('->initialize() throws a \LogicException if the node is not an input or a select'
);
} catch (\LogicException
$e) { $this->
assertTrue(true, '->initialize() throws a \LogicException if the node is not an input or a select'
);
} $node =
$this->
createNode('input', '',
['type' => 'text'
]);
try { new ChoiceFormField($node);
$this->
fail('->initialize() throws a \LogicException if the node is an input with a type different from checkbox or radio'
);
} catch (\LogicException
$e) { $this->
assertTrue(true, '->initialize() throws a \LogicException if the node is an input with a type different from checkbox or radio'
);
}