From 12de3451746890b922e238d27dbc4004cd6c75a0 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 30 May 2018 12:18:52 +0200 Subject: [PATCH] Made the testing form examples consistent --- testing.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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