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

[Security] simplify the SwitchUserListenerTest#22049

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:2.7fromxabbuh:simplify-tests
Mar 22, 2017

Conversation

@xabbuh
Copy link
Member

QA
Branch?2.7
Bug fix?no
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

While working on#22048 I noticed that theSwitchUserListenerTest was more complicated than necessary by mocking a lot of stuff that didn't need to be mocked.

Copy link
Contributor

@GuilhemNGuilhemN left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Except my question, 👍


$this->tokenStorage->expects($this->any())->method('getToken')->will($this->returnValue($token));
$this->request->expects($this->any())->method('get')->with('_switch_user')->will($this->returnValue('kuba'));
$this->request->query->expects($this->once())->method('remove','_switch_user');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

isn't this missing in the new test?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We check later on that the query parameter bag is empty.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ok i missed that 👍

@fabpot
Copy link
Member

Thank you@xabbuh.

@fabpotfabpot merged commit923bbdb intosymfony:2.7Mar 22, 2017
fabpot added a commit that referenced this pull requestMar 22, 2017
This PR was merged into the 2.7 branch.Discussion----------[Security] simplify the SwitchUserListenerTest| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |While working on#22048 I noticed that the `SwitchUserListenerTest` was more complicated than necessary by mocking a lot of stuff that didn't need to be mocked.Commits-------923bbdb [Security] simplify the SwitchUserListenerTest
@xabbuhxabbuh deleted the simplify-tests branchMarch 23, 2017 07:12
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@GuilhemNGuilhemNGuilhemN approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@xabbuh@fabpot@GuilhemN@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp