-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
Manage event response in show and index action to be able to redirect #287
Manage event response in show and index action to be able to redirect #287
Conversation
maximehuran
commented
Feb 23, 2021
•
edited
Loading
edited
Q | A |
---|---|
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | o |
Related tickets | mentioned in Sylius/Sylius#10286 |
License | MIT |
3dad002
to
d5cb982
Compare
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.
Hey Maxime 👋
thanks for the contribution. Can you also provide some tests for this behavior? The best combo would be to have Spec + functional test in PHPUnit
88c1fd0
to
68af98b
Compare
Hi, I added some PHP Spec tests. I am not sure about it but I don't know how to setup the test application for this plugin. |
Just look at the CI to see how it is set up :) |
I would like to run the CI to check my tests, I think it's the easiest solution |
ping @lchrusciel I added PHP Spec tests :) |
68af98b
to
812e698
Compare
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.
Hello Maxime 🖖 I've rebased your PR, let's see how the build passes, but it's good to go in my opinion :)
$event->getResponse()->willReturn($response); | ||
|
||
$configuration->isHtmlRequest()->shouldNotBeCalled(); | ||
$this->createRestView($configuration, $resource)->shouldNotBeCalled(); |
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.
Oh, ok, this is the problem 💃 createRestView
is a protected function inside ResourceController
, so we should rather check if $this->viewHandler
is called or not 🖖
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've allowed myself to fix it :) 🚀
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.
Thank you Mateusz you're the king !
Thanks, Maxime! 🎉 |