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
Refactor controller tests #26437
Refactor controller tests #26437
Conversation
…and each action is now separated in a dedicated test function instead of being all done in the setup
…ral times which helps debugging, no need to clean the DB at each time
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.
Very nice job, I have just seen a problem with a typo! Thank you!
tests/Integration/PrestaShopBundle/Controller/GridControllerTestCase.php
Outdated
Show resolved
Hide resolved
e58b4f8
public function handleFor($id, FormInterface $form) | ||
{ | ||
return $this->formHandler->handleFor($form, $id); | ||
return $this->formHandler->handleFor($id, $form); |
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.
😮 woah this was probably introducing bugs before?
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.
Not yet, because it was not used The edition was never tested until now
Thank you @jolelievre |
Which makes the base class difficult to reuse
The generic behaviour remains the same but everything was split into separate methods that can be used when needed
Also separate into two abstract classes depending if you need to test the grid only or the form with it (not possible to test the form without the grid though)
This change is