4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Form\Tests
;
15 * @author Bernhard Schussek <bschussek@gmail.com>
17 class CompoundFormPerformanceTest
extends \Symfony\Component\Form\Tests\FormPerformanceTestCase
20 * Create a compound form multiple times, as happens in a collection form
24 public function testArrayBasedForm()
26 $this->setMaxRunningTime(1);
28 for ($i = 0; $i < 40; ++
$i) {
29 $form = $this->factory
->createBuilder('form')
30 ->add('firstName', 'text')
31 ->add('lastName', 'text')
32 ->add('gender', 'choice', array(
33 'choices' => array('male' => 'Male', 'female' => 'Female'),
36 ->add('age', 'number')
37 ->add('birthDate', 'birthday')
38 ->add('city', 'choice', array(
39 // simulate 300 different cities
40 'choices' => range(1, 300),
44 // load the form into a view