Documentation

CiviTestListenerPHPUnit7 implements TestListener uses TestListenerDefaultImplementation

Class CiviTestListener

Tags
see
EndToEndInterface
see
HeadlessInterface
see
HookInterface

Table of Contents

Interfaces

TestListener

Properties

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

Methods

endTest()  : void
endTestSuite()  : void
startTest()  : void
startTestSuite()  : void
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

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>

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