kohana/unittest — pull request #19 by acoulton (2011-11-27 11:21:53+00:00)
Title: Support PHPUnit 3.6 by moving Code Coverage filtering into the test suite

As per this ticket http://dev.kohanaframework.org/issues/4323 PHPUnit 3.6 has removed the singleton for the code coverage filter, so this module is not compatible.

The filter is created just before the test suite is executed, and is stored in the result object that is passed into PHPUnit_Framework_TestSuite::run.

This pull therefore moves the processing of white and blacklisting into a new Kohana_Unittest_TestSuite class that stores up the calls and applies them to the code coverage filter when the suite is executed. The good news is that this approach is backwards compatible for PHPUnit 3.5 too - I haven't tested with PHPUnit 3.4 but I've left that code untouched so there should be no change to how well it works. I don't know if you'll want to retire support for PHPUnit 3.4 at some point, which would allow some of this to be made much simpler.