Skip to content

Made the testing form examples consistent #9854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down