Closed
Description
With form collections, we use Javascript to add the new fields and Symfony handles the rest.
In the following example, Office has a many-to-many with Contact.
When attempting the same approach in functional tests, e.g. by doing:
$form = $buttonCrawlerNode->form(array(
'company_whateverbundle_officetype[office_contacts][0][contact]' => '1'
));
The actual result is:
InvalidArgumentException: The form field "company_whateverbundle_officetype[office_contacts][0][contact]" does not exist.
The expected result is that a new contact is added.
Steps to reproduce:
- Create a couple of entities with a many-to-many association between them.
- Create a form with a collection field to edit the associations.
- Create a functional test and try to create a new association with it.