-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Controller response property overriding by ControllerResponse inPHPUnit #1834
Comments
What is that supposed to test? Your test doesn't show it actually testing the response lang that you set. But also - what are you doing with the $response in the controller? Unless you return a redirect response instance from the controller method, the system is designed to work with the Controller's response. So I'm confused what the bug actually is here and how you're confirming that. |
Okay, code have only block's to show error. Full test:
Full controller method:
|
I have fixed this, but there is also a problem with your test.
After json_decode, $response is an associate array, with a 'lang' key. There is no "message" property or key. |
Fix: ControllerTester::execute. Fixes #1834
name: Controller response property overriding by ControllerResponse in PHPUnit
about: ControllerResponse instance overriding property of standard Controller in unit testing controller.
Code to reproduce:
Controller:
ControllerTest:
The text was updated successfully, but these errors were encountered: