diff --git a/testing.rst b/testing.rst index 8edd0272e33..868d9f862ea 100644 --- a/testing.rst +++ b/testing.rst @@ -655,8 +655,8 @@ When calling the ``form()`` method, you can also pass an array of field values that overrides the default ones:: $form = $buttonCrawlerNode->form(array( - 'name' => 'Fabien', - 'my_form[subject]' => 'Symfony rocks!', + 'my_form[name]' => 'Fabien', + 'my_form[subject]' => 'Symfony rocks!', )); And if you want to simulate a specific HTTP method for the form, pass it as a @@ -672,15 +672,15 @@ The field values can also be passed as a second argument of the ``submit()`` method:: $client->submit($form, array( - 'name' => 'Fabien', - 'my_form[subject]' => 'Symfony rocks!', + 'my_form[name]' => 'Fabien', + 'my_form[subject]' => 'Symfony rocks!', )); For more complex situations, use the ``Form`` instance as an array to set the value of each field individually:: // changes the value of a field - $form['name'] = 'Fabien'; + $form['my_form[name]'] = 'Fabien'; $form['my_form[subject]'] = 'Symfony rocks!'; There is also a nice API to manipulate the values of the fields according to