rename message key to failureMessage

This commit is contained in:
Fabio Ivona
2022-09-19 10:37:37 +02:00
parent 8a3caa5e7f
commit bac941715a
3 changed files with 119 additions and 119 deletions

View File

@ -25,7 +25,7 @@ test('failures', function () use ($test_array) {
})->throws(ExpectationFailedException::class, "Failed asserting that an array has the key 'foo'");
test('failures with custom message', function () use ($test_array) {
expect($test_array)->toHaveKey('foo', message: 'oh no!');
expect($test_array)->toHaveKey('foo', failureMessage: 'oh no!');
})->throws(ExpectationFailedException::class, 'oh no!');
test('failures with nested key', function () use ($test_array) {
@ -33,7 +33,7 @@ test('failures with nested key', function () use ($test_array) {
})->throws(ExpectationFailedException::class, "Failed asserting that an array has the key 'd.bar'");
test('failures with nested key and custom message', function () use ($test_array) {
expect($test_array)->toHaveKey('d.bar', message: 'oh no!');
expect($test_array)->toHaveKey('d.bar', failureMessage: 'oh no!');
})->throws(ExpectationFailedException::class, 'oh no!');
test('failures with plain key with dots', function () use ($test_array) {

View File

@ -18,7 +18,7 @@ test('failures', function () use ($obj) {
})->throws(ExpectationFailedException::class);
test('failures with message', function () use ($obj) {
expect($obj)->toHaveProperty(name: 'bar', message: 'oh no!');
expect($obj)->toHaveProperty(name: 'bar', failureMessage: 'oh no!');
})->throws(ExpectationFailedException::class, 'oh no!');
test('not failures', function () use ($obj) {