-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] simplify the SwitchUserListenerTest #22049
New issue
10000Have 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
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.
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'); |
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.
isn't this missing in the new test?
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.
We check later on that the query parameter bag is empty.
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.
Ok i missed that 👍
Thank you @xabbuh. |
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
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.