You are here

public function ChoiceFormFieldTest::testOptionWithNoValue 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::testOptionWithNoValue()

File

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

Class

ChoiceFormFieldTest

Namespace

Symfony\Component\DomCrawler\Tests\Field

Code

public function testOptionWithNoValue() {
  $node = $this
    ->createSelectNodeWithEmptyOption(array(
    'foo' => false,
    'bar' => false,
  ));
  $field = new ChoiceFormField($node);
  $this
    ->assertEquals('foo', $field
    ->getValue());
  $node = $this
    ->createSelectNodeWithEmptyOption(array(
    'foo' => false,
    'bar' => true,
  ));
  $field = new ChoiceFormField($node);
  $this
    ->assertEquals('bar', $field
    ->getValue());
  $field
    ->select('foo');
  $this
    ->assertEquals('foo', $field
    ->getValue(), '->select() changes the selected option');
}