feat(expect): adds toHaveProperty

This commit is contained in:
Nuno Maduro
2020-07-14 23:37:02 +02:00
parent 32ef377284
commit 1aec8bac55
6 changed files with 42 additions and 34 deletions

View File

@ -0,0 +1,15 @@
<?php
use PHPUnit\Framework\ExpectationFailedException;
test('pass', function () {
expect([1, 2, 3])->toHaveCount(3);
});
test('failures', function () {
expect([1, 2, 3])->toHaveCount(4);
})->throws(ExpectationFailedException::class);
test('not failures', function () {
expect([1, 2, 3])->not->toHaveCount(3);
})->throws(ExpectationFailedException::class);