On this page
Matching
trait Matching (View source)
Methods
Matching | where(string $key, mixed|Closure $expected) Asserts that the property matches the expected value. |
|
Matching | whereNot(string $key, mixed|Closure $expected) Asserts that the property does not match the expected value. |
|
Matching | whereAll(array $bindings) Asserts that all properties match their expected values. |
|
Matching | whereType(string $key, string|array $expected) Asserts that the property is of the expected type. |
|
Matching | whereAllType(array $bindings) Asserts that all properties are of their expected types. |
|
$this | whereContains(string $key, mixed $expected) Asserts that the property contains the expected values. |
|
void | ensureSorted(mixed $value) Ensures that all properties are sorted the same way, recursively. |
|
string | dotPath(string $key = '') Compose the absolute "dot" path to the given key. |
|
$this | has(string $key, null $value = null, Closure $scope = null) Ensure that the given prop exists. |
|
mixed | prop(string $key = null) Retrieve a prop within the current scope using "dot" notation. |
Details
Matching where(string $key, mixed|Closure $expected)
Asserts that the property matches the expected value.
Matching whereNot(string $key, mixed|Closure $expected)
Asserts that the property does not match the expected value.
Matching whereAll(array $bindings)
Asserts that all properties match their expected values.
Matching whereType(string $key, string|array $expected)
Asserts that the property is of the expected type.
Matching whereAllType(array $bindings)
Asserts that all properties are of their expected types.
$this whereContains(string $key, mixed $expected)
Asserts that the property contains the expected values.
protected void ensureSorted(mixed $value)
Ensures that all properties are sorted the same way, recursively.
abstract protected string dotPath(string $key = '')
Compose the absolute "dot" path to the given key.
abstract $this has(string $key, null $value = null, Closure $scope = null)
Ensure that the given prop exists.
abstract protected mixed prop(string $key = null)
Retrieve a prop within the current scope using "dot" notation.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/10.x/Illuminate/Testing/Fluent/Concerns/Matching.html