Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromnowiko:simplify-functional-tests
Jul 12, 2018

Conversation

@nowiko
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
LicenseMIT

Added new methods to BrowserKit/Client to simplify work with links and forms.
Related to#27627

sstok, javiereguiluz, gmponos, and andreybolonin reacted with heart emoji
$client->setNextResponse(newResponse('<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');
Copy link
Contributor

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.

@nowiko
Copy link
ContributorAuthor

@iltar Please review that applied changes are suitable.

@linaori
Copy link
Contributor

Added test looks good to me 👍

@fabpot
Copy link
Member

I think we also tests for when the link/form is not found.

@nicolas-grekasnicolas-grekas added this to thenext milestoneJul 3, 2018
@nowiko
Copy link
ContributorAuthor

@fabpot
I have added test cases if link or form cannot be found. Please, let me know if this should be modified, or additional check for form/link existence should be performed on the method level.

@fabpotfabpotforce-pushed thesimplify-functional-tests branch from11bbed3 toe098eddCompareJuly 12, 2018 07:05
@fabpot
Copy link
Member

Thank you@nowiko.

sstok reacted with hooray emoji

@fabpotfabpot merged commite098edd intosymfony:masterJul 12, 2018
fabpot added a commit that referenced this pull requestJul 12, 2018
…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       | MITAdded new methods to BrowserKit/Client to simplify work with links and forms.Related to#27627Commits-------e098edd Added new methods submitForm and clickLink to Client class
fabpot added a commit that referenced this pull requestJul 18, 2018
…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     <!-- seehttps://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
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull requestJul 18, 2018
This PR was squashed before being merged into the master branch (closes#10071).Discussion----------Added docs for clickLink() and submitForm()This documentssymfony/symfony#27807Commits-------0668ccc Added docs for clickLink() and submitForm()
@stof
Copy link
Member

these 2 methods will trigger a fatal error if you call them before callingrequest, asgetCrawler will returnnull in that case (that's a deprecated usage, but it does not throw yet).
As these are new APIs, we should forbid them already when we don't have a crawler (thus, doing separate checks would allow to have a better exception message, as it would talk about the right method being used)

symfony-splitter pushed a commit to symfony/browser-kit that referenced this pull requestSep 29, 2018
…(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
nicolas-grekas added a commit that referenced this pull requestSep 29, 2018
…(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
@nicolas-grekasnicolas-grekas modified the milestones:next,4.2Nov 1, 2018
@fabpotfabpot mentioned this pull requestNov 3, 2018
@fabpotfabpot mentioned this pull requestNov 3, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

+1 more reviewer

@linaorilinaorilinaori requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

7 participants

@nowiko@linaori@fabpot@stof@nicolas-grekas@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp