class CiviTestListener extends PHPUnit_Framework_BaseTestListener

Class CiviTestListener

Methods

startTestSuite( $suite)

No description

endTestSuite( $suite)

No description

startTest( $test)

No description

endTest( $test, $time)

No description

bootHeadless(HeadlessInterface|PHPUnit_Framework_Test $test)

No description

array
findTestHooks( $test)

No description

bool
isCiviTest( $test)

No description

registerHooks( $test)

Find any hook functions in $test and register them.

autoboot(array $byInterface)

The first time we come across HeadlessInterface or EndToEndInterface, we'll try to autoboot.

string
cv(string $cmd, string $decode = 'json')

Call the "cv" command.

array
indexTestsByInterface($tests)

No description

validateGroups(array $byInterface)

Ensure that any tests have sensible groups, e.g.

Details

at line 35
startTestSuite( $suite)

Parameters

$suite

at line 41
endTestSuite( $suite)

Parameters

$suite

at line 45
startTest( $test)

Parameters

$test

at line 70
endTest( $test, $time)

Parameters

$test
$time

at line 87
protected bootHeadless(HeadlessInterface|PHPUnit_Framework_Test $test)

Parameters

HeadlessInterface|PHPUnit_Framework_Test $test

at line 113
protected array findTestHooks( $test)

Parameters

$test

Return Value

array Array(string $hookName => string $methodName)).

at line 131
protected bool isCiviTest( $test)

Parameters

$test

Return Value

bool

at line 140
protected registerHooks( $test)

Find any hook functions in $test and register them.

Parameters

$test

at line 165
protected autoboot(array $byInterface)

The first time we come across HeadlessInterface or EndToEndInterface, we'll try to autoboot.

Once the system is booted, there's nothing we can do -- we're stuck with that environment. (Thank you, prolific define()s!) If there's a conflict between a test-class and the active boot-level, then we'll have to bail.

Parameters

array $byInterface List of test classes, keyed by major interface (HeadlessInterface vs EndToEndInterface).

at line 209
protected string cv(string $cmd, string $decode = 'json')

Call the "cv" command.

This duplicates the standalone cv() wrapper that is recommended in bootstrap.php. This duplication is necessary because cv() is optional, and downstream implementers may alter, rename, or omit the wrapper, and (by virtue of its role in bootstrap) there it is impossible to define it centrally.

Parameters

string $cmd The rest of the command to send.
string $decode Ex: 'json' or 'phpcode'.

Return Value

string Response output (if the command executed normally).

Exceptions

RuntimeException If the command terminates abnormally.

at line 245
protected array indexTestsByInterface($tests)

Parameters

$tests

Return Value

array

at line 267
protected validateGroups(array $byInterface)

Ensure that any tests have sensible groups, e.g.

HeadlessInterface ==> group headless EndToEndInterface ==> group e2e

Parameters

array $byInterface