From 6804410aa9103a89bcbc01b3a78bbfc75b25c4fc Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Sun, 4 Apr 2021 18:23:34 +0200 Subject: [PATCH 1/3] 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 https://github.com/Codeception/module-symfony/issues/54 --- src/Codeception/Module/Symfony/BrowserAssertionsTrait.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Codeception/Module/Symfony/BrowserAssertionsTrait.php b/src/Codeception/Module/Symfony/BrowserAssertionsTrait.php index 7b417e62..f9d9e91b 100644 --- a/src/Codeception/Module/Symfony/BrowserAssertionsTrait.php +++ b/src/Codeception/Module/Symfony/BrowserAssertionsTrait.php @@ -83,8 +83,8 @@ public function seePageRedirectsTo(string $page, string $redirectsTo): void /** * Submit a form specifying the form name only once. * - * Use this function instead of $I->submitForm() to avoid repeating the form name in the field selectors. - * If you customized the names of the field selectors use $I->submitForm() for full control. + * Use this function instead of `$I->submitForm()` to avoid repeating the form name in the field selectors. + * If you customized the names of the field selectors use `$I->submitForm()` for full control. * * ```php * ` (you cannot use an array as selector here) * @param string[] $fields */ public function submitSymfonyForm(string $name, array $fields): void @@ -103,7 +103,7 @@ public function submitSymfonyForm(string $name, array $fields): void $params = []; foreach ($fields as $key => $value) { - $fixedKey = sprintf('%s%s', $name, $key); + $fixedKey = sprintf('%s[%s]', $name, $key); $params[$fixedKey] = $value; } $button = sprintf('%s_submit', $name); From d2794b200f11523bb49f7706cad68f49345e447e Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 6 Apr 2021 14:19:43 +0200 Subject: [PATCH 2/3] Update BrowserAssertionsTrait.php --- src/Codeception/Module/Symfony/BrowserAssertionsTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Codeception/Module/Symfony/BrowserAssertionsTrait.php b/src/Codeception/Module/Symfony/BrowserAssertionsTrait.php index f9d9e91b..116c42f3 100644 --- a/src/Codeception/Module/Symfony/BrowserAssertionsTrait.php +++ b/src/Codeception/Module/Symfony/BrowserAssertionsTrait.php @@ -103,7 +103,7 @@ public function submitSymfonyForm(string $name, array $fields): void $params = []; foreach ($fields as $key => $value) { - $fixedKey = sprintf('%s[%s]', $name, $key); + $fixedKey = sprintf('%s%s', $name, $key); $params[$fixedKey] = $value; } $button = sprintf('%s_submit', $name); From e46f9f5bd518e6d6585cfb2e3ce47cf0a9e63f7a Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 6 Apr 2021 15:02:45 +0200 Subject: [PATCH 3/3] Update BrowserAssertionsTrait.php --- src/Codeception/Module/Symfony/BrowserAssertionsTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Codeception/Module/Symfony/BrowserAssertionsTrait.php b/src/Codeception/Module/Symfony/BrowserAssertionsTrait.php index 116c42f3..b2a79180 100644 --- a/src/Codeception/Module/Symfony/BrowserAssertionsTrait.php +++ b/src/Codeception/Module/Symfony/BrowserAssertionsTrait.php @@ -83,7 +83,7 @@ public function seePageRedirectsTo(string $page, string $redirectsTo): void /** * Submit a form specifying the form name only once. * - * Use this function instead of `$I->submitForm()` to avoid repeating the form name in the field selectors. + * Use this function instead of [`$I->submitForm()`](#submitForm) to avoid repeating the form name in the field selectors. * If you customized the names of the field selectors use `$I->submitForm()` for full control. * * ```php