CiviTestListenerPHPUnit7
in package
implements
TestListener
uses
TestListenerDefaultImplementation
Class CiviTestListener
Tags
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
$errorScope
public
mixed
$errorScope
$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)).
$tx
private
CRM_Core_Transaction|null
$tx
Methods
endTest()
public
endTest(Test $test, float $time) : void
Parameters
- $test : Test
- $time : float
endTestSuite()
public
endTestSuite(TestSuite $suite) : void
Parameters
- $suite : TestSuite
startTest()
public
startTest(Test $test) : void
Parameters
- $test : Test
startTestSuite()
public
startTestSuite(TestSuite $suite) : void
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).
bootHeadless()
protected
bootHeadless(HeadlessInterface|Test $test) : mixed
Parameters
- $test : HeadlessInterface|Test
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
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
boolvalidateGroups()
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>