You are here

public function ChoiceFormFieldTest::testGetType in Zircon Profile 8

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

File

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

Class

ChoiceFormFieldTest

Namespace

Symfony\Component\DomCrawler\Tests\Field

Code

public function testGetType() {
  $node = $this
    ->createNode('input', '', array(
    'type' => 'radio',
    'name' => 'name',
    'value' => 'foo',
  ));
  $field = new ChoiceFormField($node);
  $this
    ->assertEquals('radio', $field
    ->getType(), '->getType() returns radio for radio buttons');
  $node = $this
    ->createNode('input', '', array(
    'type' => 'checkbox',
    'name' => 'name',
    'value' => 'foo',
  ));
  $field = new ChoiceFormField($node);
  $this
    ->assertEquals('checkbox', $field
    ->getType(), '->getType() returns radio for a checkbox');
  $node = $this
    ->createNode('select', '');
  $field = new ChoiceFormField($node);
  $this
    ->assertEquals('select', $field
    ->getType(), '->getType() returns radio for a select');
}