Skip to content

Commit 6804410

Browse files
Fixing submitSymfonyForm()
I'm not sure about this! But I think the submitted fieldname now is `myFormaddress`, instead of `myForm[address]` - that's what I'm trying to fix. I didn't take a look at the tests you mentioned in Codeception#54
1 parent bfc25c7 commit 6804410

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Codeception/Module/Symfony/BrowserAssertionsTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public function seePageRedirectsTo(string $page, string $redirectsTo): void
8383
/**
8484
* Submit a form specifying the form name only once.
8585
*
86-
* Use this function instead of $I->submitForm() to avoid repeating the form name in the field selectors.
87-
* If you customized the names of the field selectors use $I->submitForm() for full control.
86+
* Use this function instead of `$I->submitForm()` to avoid repeating the form name in the field selectors.
87+
* If you customized the names of the field selectors use `$I->submitForm()` for full control.
8888
*
8989
* ```php
9090
* <?php
@@ -94,7 +94,7 @@ public function seePageRedirectsTo(string $page, string $redirectsTo): void
9494
* ]);
9595
* ```
9696
*
97-
* @param string $name
97+
* @param string $name The `name` attribute of the `<form>` (you cannot use an array as selector here)
9898
* @param string[] $fields
9999
*/
100100
public function submitSymfonyForm(string $name, array $fields): void
@@ -103,7 +103,7 @@ public function submitSymfonyForm(string $name, array $fields): void
103103

104104
$params = [];
105105
foreach ($fields as $key => $value) {
106-
$fixedKey = sprintf('%s%s', $name, $key);
106+
$fixedKey = sprintf('%s[%s]', $name, $key);
107107
$params[$fixedKey] = $value;
108108
}
109109
$button = sprintf('%s_submit', $name);

0 commit comments

Comments
 (0)