submitSymfonyForm(): Mentioning name attribute#128
submitSymfonyForm(): Mentioning name attribute#128TavoNiievez merged 3 commits intoCodeception:masterfrom
name attribute#128Conversation
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
|
As shown in the code example, $I->submitSymfonyForm('login_form', [
'[email]' => 'john_doe@example.com',
'[password]' => 'secretForest'
]);You need to add brackets to the key of the field that is passed as argument (eg. [password][first] => 'mysupersecretpass'
[password][second] => 'mysupersecretpass'and at the time I thought it would be better to leave the bracket syntax as it is ... Or at least, it was better than inventing a special syntax just to send compound fields to this function.
yes, the functions that are in BrowserAssertionTrait don't really use any framework-specific Symfony class. Neither of forms nor of anything else. What is the same, they could be integrated in Innerbrowser and be available in all modules.
The idea of doing this is to be very sure that both the API and the documentation are well designed and written, that it is understood and that they are used by people when writing their tests. So my hope is that in some future those functions can be copied to InnerBrowser and removed from this module. |
|
btw, don't forget to tag me when you ask questions directed at me, I am not the only maintainer of this module :-) |
name attribute
|
Sorry, I overlooked the brackets ;-) |
|
Thank you. |
I'm not sure about this!
But I think the submitted fieldname now is
myFormaddress, instead ofmyForm[address]- that's what I'm trying to fix.I didn't take a look at the tests you mentioned in #54
BTW: I was first looking for this method in
FormAssertionsTrait.php, is there a reason why you put it intoBrowserAssertionsTrait.php?