Closed snewell92 closed 7 years ago
TL;DR: Unit tests for Mibew 2.x are impossible.
Long version
At the moment it's just impossible to implement unit tests with enough coverage. Here are the reasons:
If one need to add unit tests he must refactor the codebase to make it "testable".
I've highlighted word "unit", because unit tests are not the only option. I believe one could start with acceptance tests (with something like Codeception) then refactor the codebase with creating unit tests during this process.
At the same time we cannot just refactor the codebase in 2.x branch because we can break existing third-party plugin. The only option is to do it for Mibew 3.x.
As for me, I have neither free time nor motivation (sorry) for working on Mibew 3.x.
Thanks for the reply!
I understand the difficulty in unit testing globals/coupled code. Maybe add a label for 3.x milestone when someone gets around to that?
One should clearly understand the direction of the project development before adding any labels and milestones. ;)
Relevant links, from the symfony docs and phpunit site.
Mibew already has a
tests
folder with aserver_side
sub-folder, but there isn't anything in there 😢It would be nice to have a full test suite so that forkers/plugin authors can add relevant tests and have safe roll-back-able deployments that test the plugin's integration into Mibew.
What do y'all think? Good idea, bad idea? Put it on the road map? Has there been any effort made in this direction before, and if so any roadblocks to adoption PHPUnit?
Thanks for reading! 😸