-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Added new methods submitForm and clickLink to Client class #27807
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
Conversation
$client->setNextResponse(new Response('<html><form action="/foo"><input type="submit" value="Register" /></form></html>')); | ||
$client->request('GET', 'http://www.example.com/foo/foobar'); | ||
|
||
$client->submitForm('Register', array(), 'POST'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice to add a test case where actual values are submitted along, this case is not covered right now.
@iltar Please review that applied changes are suitable. |
Added test looks good to me 👍 |
I think we also tests for when the link/form is not found. |
@fabpot |
11bbed3
to
e098edd
Compare
Thank you @nowiko. |
…lass (nowiko) This PR was squashed before being merged into the 4.2-dev branch (closes #27807). Discussion ---------- Added new methods submitForm and clickLink to Client class | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT Added new methods to BrowserKit/Client to simplify work with links and forms. Related to #27627 Commits ------- e098edd Added new methods submitForm and clickLink to Client class
…itForm() methods (javiereguiluz) This PR was squashed before being merged into the 4.2-dev branch (closes #27956). Discussion ---------- Added types and tweaked PHPdoc of clickLink() and submitForm() methods | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | - <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | - I wanted to suggest these changes to #27807 but I failed to do that before it was merged. Commits ------- be9d578 Added types and tweaked PHPdoc of clickLink() and submitForm() methods
This PR was squashed before being merged into the master branch (closes #10071). Discussion ---------- Added docs for clickLink() and submitForm() This documents symfony/symfony#27807 Commits ------- 0668ccc Added docs for clickLink() and submitForm()
these 2 methods will trigger a fatal error if you call them before calling |
…(xabbuh) This PR was merged into the 4.2-dev branch. Discussion ---------- [BrowserKit] throw exception when request() wasn't called | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony#27807 (comment) Commits ------- 41cfde19f6 throw exception when request() wasn't called
…(xabbuh) This PR was merged into the 4.2-dev branch. Discussion ---------- [BrowserKit] throw exception when request() wasn't called | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | #27807 (comment) Commits ------- 41cfde1 throw exception when request() wasn't called
Added new methods to BrowserKit/Client to simplify work with links and forms.
Related to #27627