This class is a transparent base class for Unittest_TestSuite and should not be accessed directly.
A version of the stock PHPUnit testsuite that supports whitelisting and blacklisting for code coverage filter[!!] This class, or a class parent, could not be found or loaded. This could be caused by a missing module or other dependancy. The documentation for class may not be complete!
Class declared in MODPATH/unittest/classes/Kohana/Unittest/TestSuite.php on line 7.
array
$_filter_callsHolds the details of files that should be white and blacklisted for code coverage
array(3) ( "addFileToBlacklist" => array(0) "addDirectoryToBlacklist" => array(0) "addFileToWhitelist" => array(0) )
Queues a directory to be added to the code coverage blacklist when the suite runs
string
$dir
required - $dir public function addDirectoryToBlacklist($dir)
{
$this->_filter_calls['addDirectoryToBlacklist'][] = $dir;
}
Queues a file to be added to the code coverage blacklist when the suite runs
string
$file
required - $file public function addFileToBlacklist($file)
{
$this->_filter_calls['addFileToBlacklist'][] = $file;
}
Queues a file to be added to the code coverage whitelist when the suite runs
string
$file
required - $file public function addFileToWhitelist($file)
{
$this->_filter_calls['addFileToWhitelist'][] = $file;
}
Runs the tests and collects their result in a TestResult.
PHPUnit_Framework_TestResult
$result
= NULL - $result mixed
$filter
= bool FALSE - $filter array
$groups
= array(0) - $groups array
$excludeGroups
= array(0) - $excludeGroups boolean
$processIsolation
= bool FALSE - $processIsolation PHPUnit_Framework_TestResult
public function run(PHPUnit_Framework_TestResult $result = null, $filter = false, array $groups = [], array $excludeGroups = [], $processIsolation = false)
{
// Get the code coverage filter from the suite's result object
$coverage = $result->getCodeCoverage();
if ($coverage) {
$coverage_filter = $coverage->filter();
// Apply the white and blacklisting
foreach ($this->_filter_calls as $method => $args) {
foreach ($args as $arg) {
$coverage_filter->$method($arg);
}
}
}
return parent::run($result, $filter, $groups, $excludeGroups, $processIsolation);
}
Creates classes when they are otherwise not found.
Kodoc::create_class('ThisClassDoesNotExist');
All classes created will extend Kodoc_Missing.
string
$class
required - Class name boolean
public static function create_class($class)
{
if (!class_exists($class)) {
// Create a new missing class
eval("class {$class} extends Kodoc_Missing {}");
}
return true;
}