You are here

public function FormTest::testFormRegistrySupportsMultivaluedFields in Zircon Profile 8

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

File

vendor/symfony/dom-crawler/Tests/FormTest.php, line 757

Class

FormTest

Namespace

Symfony\Component\DomCrawler\Tests

Code

public function testFormRegistrySupportsMultivaluedFields() {
  $registry = new FormFieldRegistry();
  $registry
    ->add($this
    ->getFormFieldMock('foo[]'));
  $registry
    ->add($this
    ->getFormFieldMock('foo[]'));
  $registry
    ->add($this
    ->getFormFieldMock('bar[5]'));
  $registry
    ->add($this
    ->getFormFieldMock('bar[]'));
  $registry
    ->add($this
    ->getFormFieldMock('bar[baz]'));
  $this
    ->assertEquals(array(
    'foo[0]',
    'foo[1]',
    'bar[5]',
    'bar[6]',
    'bar[baz]',
  ), array_keys($registry
    ->all()));
}