EventCheck
in package
An EventCheck is a fragment of a unit-test -- it is mixed into various test-scenarios and applies extra assertions.
Table of Contents
Methods
- assertContains() : void
- assertEquals() : void
- assertMatchesRegularExpression() : void
- assertNotEmpty() : void
- assertTrue() : void
- assertType() : mixed
- Assert that a variable has a given type.
- fail() : void
- isSupported() : bool|string
- Determine whether this check should be used during the current test.
Methods
assertContains()
public
static assertContains(mixed $needle, iterable<string|int, mixed> $haystack[, string $message = '' ]) : void
Parameters
- $needle : mixed
- $haystack : iterable<string|int, mixed>
- $message : string = ''
assertEquals()
public
static assertEquals(mixed $expected, mixed $actual[, string $message = '' ]) : void
Parameters
- $expected : mixed
- $actual : mixed
- $message : string = ''
assertMatchesRegularExpression()
public
static assertMatchesRegularExpression(string $pattern, string $string[, string $message = '' ]) : void
Parameters
- $pattern : string
- $string : string
- $message : string = ''
assertNotEmpty()
public
static assertNotEmpty(mixed $actual[, string $message = '' ]) : void
Parameters
- $actual : mixed
- $message : string = ''
assertTrue()
public
static assertTrue(mixed $condition[, string $message = '' ]) : void
Parameters
- $condition : mixed
- $message : string = ''
assertType()
Assert that a variable has a given type.
public
assertType(string|array<string|int, string> $types, mixed $value[, string|null $message = '' ]) : mixed
Parameters
- $types : string|array<string|int, string>
-
List of types, per
gettype()
orget_class()
Ex: 'int|string|NULL' Ex: [array
,NULL
,CRM_Core_DAO
] - $value : mixed
-
The variable to check
- $message : string|null = ''
Tags
fail()
public
static fail([string $message = '' ]) : void
Parameters
- $message : string = ''
isSupported()
Determine whether this check should be used during the current test.
public
isSupported(Test|null $test) : bool|string
Parameters
- $test : Test|null
Return values
bool|string —FALSE: The check will be completely skipped. TRUE: The check will be enabled. However, if the events never execute, that is OK. Useful for general compliance-testing.