Closed
Description
I've created TestFormType
class TestType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('text', 'text')
->add('choice', 'choice', ['choices' => ['FOO' => 'foo', 'BAR' => 'bar'], 'expanded' => true])
;
}
public function getName()
{
return 'test';
}
}
created the form and trying to submit data
$data = [
'text' => 'foo',
'choice' => 'foo',
];
$form = $this->createForm('test', $data);
$form->submit(
[
'text' => 'bar',
'choice' => 'bar',
],
false
);
and now $form->getData()
will return an array:
array (size=2)
'text' => string 'bar' (length=3)
'choice' => string 'foo' (length=3)
I expect to receive bar
for both fields.
I'm working on the latest version of 4.4 branch
See the reproducer for this issue https://github.com/ossinkine/symfony-issue-16802