My tested code is full of final static classes. and while we can't refactor it for better tests, i have a intermediate solution that runs several small tests on it's own process. and all works fine. but i get no coverage report as one overwrite the other.
I'm currently generating the report in clover, but i am very open to other reports.
my tests only work when phpunit is run as:
/home/y/bin/phpunit --coverage-html clover --coverage-clover clover/report.xml --include-path src/ tests/aTest.php
OK (1 test, 1 assertions)
/home/y/bin/phpunit --coverage-html clover --coverage-clover clover/report.xml --include-path src/ tests/bTest.php
OK (1 test, 1 assertions)
/home/y/bin/phpunit --coverage-html clover --coverage-clover clover/report.xml --include-path src/ tests/cTest.php
OK (1 test, 1 assertions)
But that will result in each run wipping the report from the previous. So i only get a report for the last one. And if i try to run them as phpunit expects to generate the full report, i have the failure because all my classes include their own static ones.
/home/y/bin/phpunit --coverage-html clover --coverage-clover clover/report.xml --include-path src/ tests/
. (first test pass)
PHP Fatal error: Cannot redeclare class Something
make[1]: *** [phpunit_run] Error 255
(but the above will fail even with --process-isolation --no-globals-backup because are not exactly what they mean...) -- This is NOT yet another question on how to get properly process isolation on php unit. i'm fine running it several times, i just want a full coverage report :)
Is there any way to get the tests to run correctly (i.e. on several process to avoid tainted global class declaration space) like the first code block, but still have comprehensive code coverage report?
thank you!