class CompoundFormPerformanceTest extends FormPerformanceTestCase
{ /**
* Create a compound form multiple times, as happens in a collection form.
*
* @group benchmark
*/
public function testArrayBasedForm() { $this->
setMaxRunningTime(1
);
for ($i = 0;
$i < 40; ++
$i) { $form =
$this->factory->
createBuilder('Symfony\Component\Form\Extension\Core\Type\FormType'
) ->
add('firstName', 'Symfony\Component\Form\Extension\Core\Type\TextType'
) ->
add('lastName', 'Symfony\Component\Form\Extension\Core\Type\TextType'
) ->
add('color', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType',
[ 'choices' =>
['red' => 'Red', 'blue' => 'Blue'
],
'required' => false,
]) ->
add('age', 'Symfony\Component\Form\Extension\Core\Type\NumberType'
) ->
add('birthDate', 'Symfony\Component\Form\Extension\Core\Type\BirthdayType'
)