GenericAssertionsTrait
Class ExtraAssertionsTrait
Table of Contents
Methods
- assertArrayKeyExists() : mixed
- assertArrayValuesEqual() : mixed
- Assert the 2 arrays have the same values.
- assertAttributesEquals() : mixed
- Assert attributes are equal.
- assertTreeEquals() : mixed
- Assert that two array-trees are exactly equal.
- assertLike() : void
- Assert 2 sql strings are the same, ignoring double spaces.
Methods
assertArrayKeyExists()
public
assertArrayKeyExists(string|int $key, array<string|int, mixed> &$list) : mixed
Parameters
- $key : string|int
- $list : array<string|int, mixed>
assertArrayValuesEqual()
Assert the 2 arrays have the same values.
public
assertArrayValuesEqual(array<string|int, mixed> $array1, array<string|int, mixed> $array2) : mixed
The order of arrays, and keys of the arrays, do not affect the outcome.
Parameters
- $array1 : array<string|int, mixed>
- $array2 : array<string|int, mixed>
assertAttributesEquals()
Assert attributes are equal.
public
assertAttributesEquals(array<string|int, mixed> $expectedValues, array<string|int, mixed> $actualValues[, string $message = null ]) : mixed
Parameters
- $expectedValues : array<string|int, mixed>
- $actualValues : array<string|int, mixed>
- $message : string = null
Tags
assertTreeEquals()
Assert that two array-trees are exactly equal.
public
assertTreeEquals(array<string|int, mixed> $expected, array<string|int, mixed> $actual) : mixed
The ordering of keys do not affect the outcome (within either the roots or in any child elements).
Error messages will reveal a readable -path-, regardless of how many levels of nesting are present.
Parameters
- $expected : array<string|int, mixed>
- $actual : array<string|int, mixed>
assertLike()
Assert 2 sql strings are the same, ignoring double spaces.
protected
assertLike(string $expectedSQL, string $actualSQL[, string $message = 'different sql' ]) : void
Parameters
- $expectedSQL : string
- $actualSQL : string
- $message : string = 'different sql'