mirror of
https://github.com/pestphp/pest.git
synced 2026-03-10 17:57:23 +01:00
add custom message to failed expectations
This commit is contained in:
@ -17,6 +17,13 @@ test('failures', function () {
|
||||
expect($object)->toHaveProperties(['name', 'age']);
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
test('failures with custom message', function () {
|
||||
$object = new stdClass();
|
||||
$object->name = 'Jhon';
|
||||
|
||||
expect($object)->toHaveProperties(['name', 'age'], 'oh no!');
|
||||
})->throws(ExpectationFailedException::class, 'oh no!');
|
||||
|
||||
test('not failures', function () {
|
||||
$object = new stdClass();
|
||||
$object->name = 'Jhon';
|
||||
|
||||
Reference in New Issue
Block a user