Modules

abstract Kohana_Unittest_TestSuite
extends PHPUnit_Framework_TestSuite
extends Kodoc_Missing
extends Kohana_Kodoc_Missing

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!

A version of the stock PHPUnit testsuite that supports whitelisting and blacklisting for code coverage filter

Class declared in MODPATH/unittest/classes/kohana/unittest/testsuite.php on line 7.

Properties

protected array $_filter_calls

Holds the details of files that should be white and blacklisted for code coverage

Methods

public addDirectoryToBlacklist( string $dir ) (defined in Kohana_Unittest_TestSuite)

Queues a directory to be added to the code coverage blacklist when the suite runs

Parameters

  • string $dir required - $dir

Source Code

public function addDirectoryToBlacklist($dir)
{
	$this->_filter_calls['addDirectoryToBlacklist'][] = $dir;
}

public addFileToBlacklist( string $file ) (defined in Kohana_Unittest_TestSuite)

Queues a file to be added to the code coverage blacklist when the suite runs

Parameters

  • string $file required -

Source Code

public function addFileToBlacklist($file)
{
	$this->_filter_calls['addFileToBlacklist'][] = $file;
}

public addFileToWhitelist( string $file ) (defined in Kohana_Unittest_TestSuite)

Queues a file to be added to the code coverage whitelist when the suite runs

Parameters

  • string $file required -

Source Code

public function addFileToWhitelist($file)
{
	$this->_filter_calls['addFileToWhitelist'][] = $file;
}

public run( [ PHPUnit_Framework_TestResult $result = NULL , mixed $filter = bool FALSE , array $groups = array(0) , array $excludeGroups = array(0) , boolean $processIsolation = bool FALSE ] ) (defined in Kohana_Unittest_TestSuite)

Runs the tests and collects their result in a TestResult.

Parameters

  • 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

Tags

Return Values

  • PHPUnit_Framework_TestResult

Source Code

public function run(PHPUnit_Framework_TestResult $result = NULL, $filter = FALSE, array $groups = array(), array $excludeGroups = array(), $processIsolation = FALSE)
{

 Get the code coverage filter from the suite's result object
overage = $result->getCodeCoverage();

 ($coverage)

coverage_filter = $coverage->filter();

/ Apply the white and blacklisting
oreach ($this->_filter_calls as $method => $args)

foreach ($args as $arg)
{
	$coverage_filter->$method($arg);
}



turn parent::run($result, $filter, $groups, $excludeGroups, $processIsolation);

public static create_class( string $class ) (defined in Kohana_Kodoc_Missing)

Creates classes when they are otherwise not found.

Kodoc::create_class('ThisClassDoesNotExist');

All classes created will extend Kodoc_Missing.

Parameters

  • string $class required - Class name

Tags

  • Since - 3.0.7

Return Values

  • boolean

Source Code

public static function create_class($class)
{
	if ( ! class_exists($class))
	{
		// Create a new missing class
		eval("class {$class} extends Kodoc_Missing {}");
	}

	return TRUE;
}