trait Matching

Methods

where(string $key, mixed $expected)

Assert that the property matches the expected value.

whereNot(string $key, mixed $expected)

Assert that the property does not match the expected value.

whereNull(string $key)

Assert that the property is null.

whereNotNull(string $key)

Assert that the property is not null.

whereAll(array $bindings)

Assert that all properties match their expected values.

whereType(string $key, array|string $expected)

Assert that the property is of the expected type.

whereAllType(array $bindings)

Assert that all properties are of their expected types.

whereContains(string $key, mixed $expected)

Assert that the property contains the expected values.

void
ensureSorted(mixed $value)

Ensure that all properties are sorted the same way, recursively.

string
dotPath(string $key = '')

Compose the absolute "dot" path to the given key.

has(string|int $key, int|Closure|null $value = null, Closure|null $scope = null)

Ensure that the given prop exists.

mixed
prop(string|null $key = null)

Retrieve a prop within the current scope using "dot" notation.

Details

at line 19
Matching where(string $key, mixed $expected)

Assert that the property matches the expected value.

Parameters

string $key
mixed $expected

Return Value

Matching

at line 53
Matching whereNot(string $key, mixed $expected)

Assert that the property does not match the expected value.

Parameters

string $key
mixed $expected

Return Value

Matching

at line 92
Matching whereNull(string $key)

Assert that the property is null.

Parameters

string $key

Return Value

Matching

at line 112
Matching whereNotNull(string $key)

Assert that the property is not null.

Parameters

string $key

Return Value

Matching

at line 132
Matching whereAll(array $bindings)

Assert that all properties match their expected values.

Parameters

array $bindings

Return Value

Matching

at line 144
Matching whereType(string $key, array|string $expected)

Assert that the property is of the expected type.

Parameters

string $key
array|string $expected

Return Value

Matching

at line 166
Matching whereAllType(array $bindings)

Assert that all properties are of their expected types.

Parameters

array $bindings

Return Value

Matching

at line 178
Matching whereContains(string $key, mixed $expected)

Assert that the property contains the expected values.

Parameters

string $key
mixed $expected

Return Value

Matching

at line 219
protected void ensureSorted(mixed $value)

Ensure that all properties are sorted the same way, recursively.

Parameters

mixed $value

Return Value

void

at line 235
abstract protected string dotPath(string $key = '')

Compose the absolute "dot" path to the given key.

Parameters

string $key

Return Value

string

at line 240
abstract Matching has(string|int $key, int|Closure|null $value = null, Closure|null $scope = null)

Ensure that the given prop exists.

Parameters

string|int $key
int|Closure|null $value
Closure|null $scope

Return Value

Matching

at line 245
abstract protected mixed prop(string|null $key = null)

Retrieve a prop within the current scope using "dot" notation.

Parameters

string|null $key

Return Value

mixed