Skip to content

[BrowserKit] Fix doc about submitForm behaviour #60264

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

Open
wants to merge 1 commit into
base: 6.4
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/Symfony/Component/BrowserKit/AbstractBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public function submit(Form $form, array $values = [], array $serverParameters =
* Finds the first form that contains a button with the given content and
* uses it to submit the given form field values.
*
* @param string $button The text content, id, value or name of the form <button> or <input type="submit">
* @param string $button The text content, id or name of the form <button> or <input type="submit">
* @param array $fieldValues Use this syntax: ['my_form[name]' => '...', 'my_form[email]' => '...']
* @param string $method The HTTP method used to submit the form
* @param array $serverParameters These values override the ones stored in $_SERVER (HTTP headers must include an HTTP_ prefix as PHP does)
Expand All @@ -320,7 +320,7 @@ public function submitForm(string $button, array $fieldValues = [], string $meth
$buttonNode = $crawler->selectButton($button);

if (0 === $buttonNode->count()) {
throw new InvalidArgumentException(sprintf('There is no button with "%s" as its content, id, value or name.', $button));
throw new InvalidArgumentException(sprintf('There is no button with "%s" as its content, id or name.', $button));
}

$form = $buttonNode->form($fieldValues, $method);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public function testSubmitFormNotFound()
$client->request('GET', 'http://www.example.com/foo/foobar');

$this->expectExceptionObject(
new InvalidArgumentException('There is no button with "Register" as its content, id, value or name.')
new InvalidArgumentException('There is no button with "Register" as its content, id or name.')
);

$client->submitForm('Register', [
Expand Down
Loading