Adds toMatchObject

This commit is contained in:
Nuno Maduro
2020-09-15 21:53:25 +02:00
parent 9b5f664f00
commit 4e184b2f90
3 changed files with 62 additions and 3 deletions

View File

@ -2,11 +2,15 @@
use PHPUnit\Framework\ExpectationFailedException;
$obj = new stdClass();
$obj->foo = 'bar';
$obj = new stdClass();
$obj->foo = 'bar';
$obj->fooNull = null;
test('pass', function () use ($obj) {
expect($obj)->toHaveProperty('foo');
expect($obj)->toHaveProperty('foo', 'bar');
expect($obj)->toHaveProperty('fooNull');
expect($obj)->toHaveProperty('fooNull', null);
});
test('failures', function () use ($obj) {