class TestRunner extends BaseTestRunner (View source)

A TestRunner for the Command Line Interface (CLI) PHP SAPI Module.

Constants

STATUS_PASSED

STATUS_SKIPPED

STATUS_INCOMPLETE

STATUS_FAILURE

STATUS_ERROR

STATUS_RISKY

STATUS_WARNING

SUITE_METHODNAME

SUCCESS_EXIT

FAILURE_EXIT

EXCEPTION_EXIT

Properties

protected Filter $codeCoverageFilter
protected TestSuiteLoader $loader
protected ResultPrinter $printer
static protected bool $versionStringPrinted

Methods

getLoader()

Returns the loader to be used.

Test|null
getTest(string $suiteClassName, string $suiteClassFile = '', mixed $suffixes = '')

Returns the Test corresponding to the given suite.

loadSuiteClass(string $suiteClassName, string $suiteClassFile = '')

Returns the loaded ReflectionClass for a suite name.

clearStatus()

Clears the status message.

runFailed(string $message)

Override to define how to handle a failed loading of a test suite.

__construct(TestSuiteLoader $loader = null, Filter $filter = null)

No description

static TestResult
run(Test|ReflectionClass $test, array $arguments = [])

No description

createTestResult()

No description

doRun(Test $suite, array $arguments = [], bool $exit = true)

No description

setPrinter(ResultPrinter $resultPrinter)

No description

write(string $buffer)

No description

handleConfiguration(array $arguments)

No description

Details

TestSuiteLoader getLoader()

Returns the loader to be used.

Return Value

TestSuiteLoader

Test|null getTest(string $suiteClassName, string $suiteClassFile = '', mixed $suffixes = '')

Returns the Test corresponding to the given suite.

This is a template method, subclasses override the runFailed() and clearStatus() methods.

Parameters

string $suiteClassName
string $suiteClassFile
mixed $suffixes

Return Value

Test|null

protected ReflectionClass loadSuiteClass(string $suiteClassName, string $suiteClassFile = '')

Returns the loaded ReflectionClass for a suite name.

Parameters

string $suiteClassName
string $suiteClassFile

Return Value

ReflectionClass

protected clearStatus()

Clears the status message.

protected runFailed(string $message)

Override to define how to handle a failed loading of a test suite.

Parameters

string $message

__construct(TestSuiteLoader $loader = null, Filter $filter = null)

Parameters

TestSuiteLoader $loader
Filter $filter

static TestResult run(Test|ReflectionClass $test, array $arguments = [])

Parameters

Test|ReflectionClass $test
array $arguments

Return Value

TestResult

Exceptions

Exception

protected TestResult createTestResult()

Return Value

TestResult

TestResult doRun(Test $suite, array $arguments = [], bool $exit = true)

Parameters

Test $suite
array $arguments
bool $exit

Return Value

TestResult

setPrinter(ResultPrinter $resultPrinter)

Parameters

ResultPrinter $resultPrinter

protected write(string $buffer)

Parameters

string $buffer

protected handleConfiguration(array $arguments)

Parameters

array $arguments