Subset
extends MatcherAbstract
in package
Table of Contents
- $_expected : mixed
- The expected value (or part thereof)
- $expected : mixed
- $strict : mixed
- __construct() : mixed
- Set the expected value
- __toString() : string
- Return a string representation of this Matcher
- loose() : Subset
- match() : bool
- Check if the actual value matches the expected.
- strict() : Subset
Properties
$_expected
The expected value (or part thereof)
protected
mixed
$_expected
= null
$expected
private
mixed
$expected
$strict
private
mixed
$strict
= true
Methods
__construct()
Set the expected value
public
__construct(array<string|int, mixed> $expected[, bool $strict = true ]) : mixed
Parameters
- $expected : array<string|int, mixed>
-
Expected subset of data
- $strict : bool = true
-
Whether to run a strict or loose comparison
Return values
mixed —__toString()
Return a string representation of this Matcher
public
__toString() : string
Return values
string —loose()
public
static loose(array<string|int, mixed> $expected) : Subset
Parameters
- $expected : array<string|int, mixed>
-
Expected subset of data
Return values
Subset —match()
Check if the actual value matches the expected.
public
match(mixed &$actual) : bool
Parameters
- $actual : mixed
Return values
bool —strict()
public
static strict(array<string|int, mixed> $expected) : Subset
Parameters
- $expected : array<string|int, mixed>
-
Expected subset of data