class PhpUnitWrapper implements IPhpUnitWrapper (View source)

PHPUnit Wrapper class.

Base class for PHPUnit wrapper classes to support different PHPUnit versions. The current implementation supports PHPUnit 3.4 and PHPUnit 3.5.

Methods

bool
getCoverageStatus()

Getter for $coverage (see $coverage).

setCoverageStatus($value)

Setter for $coverage (see $coverage).

PHPUnit_Framework_TestSuite
getSuite()

Getter for $suite (see $suite).

setSuite($value)

Setter for $suite (see $suite).

PHPUnit_Framework_TestListener
getReporter()

Getter for $reporter (see $reporter).

setReporter($value)

Setter for $reporter (see $reporter).

PHPUnit_Framework_TestResult
getFrameworkTestResults()

Getter for $results (see $results).

setFrameworkTestResults($value)

Setter for $results (see $results).

string
getVersion()

Getter for $version (see $version).

static PhpUnitWrapper
inst()

Loads and initiates phpunit, based on the available phpunit version.

static bool
has_php_unit()

Returns true if one of the two supported PHPUNIT versions is installed.

init()

Implements method, defined in the interface IPhpUnitWrapper:init (see IPhpUnitWrapper).

runTests()

Perform all tests, added to the suite and initialises SilverStripe to collect the results of the unit tests.

Details

bool getCoverageStatus()

Getter for $coverage (see $coverage).

Return Value

bool

setCoverageStatus($value)

Setter for $coverage (see $coverage).

Parameters

$value

PHPUnit_Framework_TestSuite getSuite()

Getter for $suite (see $suite).

Return Value

PHPUnit_Framework_TestSuite

setSuite($value)

Setter for $suite (see $suite).

Parameters

$value

PHPUnit_Framework_TestSuite

PHPUnit_Framework_TestListener getReporter()

Getter for $reporter (see $reporter).

Return Value

PHPUnit_Framework_TestListener

setReporter($value)

Setter for $reporter (see $reporter).

Parameters

$value

PHPUnit_Framework_TestListener

PHPUnit_Framework_TestResult getFrameworkTestResults()

Getter for $results (see $results).

Return Value

PHPUnit_Framework_TestResult

setFrameworkTestResults($value)

Setter for $results (see $results).

Parameters

$value

PHPUnit_Framework_TestResult

string getVersion()

Getter for $version (see $version).

Return Value

string

static PhpUnitWrapper inst()

Loads and initiates phpunit, based on the available phpunit version.

Return Value

PhpUnitWrapper

Instance of the php-wrapper class

static bool has_php_unit()

Returns true if one of the two supported PHPUNIT versions is installed.

Return Value

bool

true if PHPUnit has been installed on the environment.

init()

Implements method, defined in the interface IPhpUnitWrapper:init (see IPhpUnitWrapper).

This wrapper class doesn't require any initialisation.

runTests()

Perform all tests, added to the suite and initialises SilverStripe to collect the results of the unit tests.

This method calls see beforeRunTests and see afterRunTests.