class CiviTestListener extends BaseTestListener

Class CiviTestListener

Methods

startTestSuite(TestSuite $suite)

No description

endTestSuite(TestSuite $suite)

No description

startTest(Test $test)

No description

endTest(Test $test, $time)

No description

bootHeadless(HeadlessInterface|Test $test)

No description

array
findTestHooks(HookInterface $test)

No description

bool
isCiviTest(Test $test)

No description

registerHooks(HookInterface $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 42
startTestSuite(TestSuite $suite)

Parameters

TestSuite $suite

at line 48
endTestSuite(TestSuite $suite)

Parameters

TestSuite $suite

at line 52
startTest(Test $test)

Parameters

Test $test

at line 77
endTest(Test $test, $time)

Parameters

Test $test
$time

at line 94
protected bootHeadless(HeadlessInterface|Test $test)

Parameters

HeadlessInterface|Test $test

at line 121
protected array findTestHooks(HookInterface $test)

Parameters

HookInterface $test

Return Value

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

at line 139
protected bool isCiviTest(Test $test)

Parameters

Test $test

Return Value

bool

at line 148
protected registerHooks(HookInterface $test)

Find any hook functions in $test and register them.

Parameters

HookInterface $test

at line 173
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 221
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 257
protected array indexTestsByInterface($tests)

Parameters

$tests

Return Value

array

at line 279
protected validateGroups(array $byInterface)

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

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

Parameters

array $byInterface