Compare the expected with the result. If $result is null $expected equals $type
and $result equals $expected.
protected _compare ( string $type, mixed $expected, mixed $result = null, string $trace = null ) : array | ||
$type | string | The type of comparison either `'identical'` or `'equal'` (default). |
$expected | mixed | The expected value. |
$result | mixed | An optional result value, defaults to `null` |
$trace | string | An optional trace used internally to track arrays and objects, defaults to `null`. |
Результат | array | Data with the keys `trace'`, `'expected'` and `'result'`. |