mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
add custom message to failed expectations
This commit is contained in:
@ -17,6 +17,10 @@ test('failures', function () use ($obj) {
|
||||
expect($obj)->toHaveProperty('bar');
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
test('failures with message', function () use ($obj) {
|
||||
expect($obj)->toHaveProperty(name: 'bar', message: 'oh no!');
|
||||
})->throws(ExpectationFailedException::class, 'oh no!');
|
||||
|
||||
test('not failures', function () use ($obj) {
|
||||
expect($obj)->not->toHaveProperty('foo');
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
Reference in New Issue
Block a user