Documentation

CiviTestListener extends BaseTestListener

Class CiviTestListener

Tags
see
EndToEndInterface
see
HeadlessInterface
see
HookInterface

Table of Contents

Properties

$errorScope  : CRM_Core_TemporaryErrorScope|null
$cache  : array<string|int, mixed>
$tx  : CRM_Core_Transaction|null

Methods

endTest()  : mixed
endTestSuite()  : mixed
startTest()  : mixed
startTestSuite()  : mixed
autoboot()  : mixed
The first time we come across HeadlessInterface or EndToEndInterface, we'll try to autoboot.
bootHeadless()  : mixed
cv()  : string
Call the "cv" command.
indexTestsByInterface()  : array<string|int, mixed>
isCiviTest()  : bool
validateGroups()  : mixed
Ensure that any tests have sensible groups, e.g.

Properties

$cache

private array<string|int, mixed> $cache = []

Ex: $cache['Some_Test_Class']['civicrm_foobar'] = 'hook_civicrm_foobar'; Array(string $testClass => Array(string $hookName => string $methodName)).

Methods

endTest()

public endTest(Test $test, mixed $time) : mixed
Parameters
$test : Test
$time : mixed

endTestSuite()

public endTestSuite(TestSuite $suite) : mixed
Parameters
$suite : TestSuite

startTest()

public startTest(Test $test) : mixed
Parameters
$test : Test

startTestSuite()

public startTestSuite(TestSuite $suite) : mixed
Parameters
$suite : TestSuite

autoboot()

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

protected autoboot(array<string|int, mixed> $byInterface) : mixed

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
$byInterface : array<string|int, mixed>

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

cv()

Call the "cv" command.

protected cv(string $cmd[, string $decode = 'json' ]) : string

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
$cmd : string

The rest of the command to send.

$decode : string = 'json'

Ex: 'json' or 'phpcode'.

Tags
throws
RuntimeException

If the command terminates abnormally.

Return values
string

Response output (if the command executed normally).

indexTestsByInterface()

protected indexTestsByInterface(mixed $tests) : array<string|int, mixed>
Parameters
$tests : mixed
Return values
array<string|int, mixed>

isCiviTest()

protected isCiviTest(Test $test) : bool
Parameters
$test : Test
Return values
bool

validateGroups()

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

protected validateGroups(array<string|int, mixed> $byInterface) : mixed

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

Parameters
$byInterface : array<string|int, mixed>

        
On this page

Search results