feat(expect): adds toBe

This commit is contained in:
Nuno Maduro
2020-07-06 00:32:12 +02:00
parent 3eb0a95955
commit 01b9bab55f
5 changed files with 145 additions and 2 deletions

19
tests/Expect/ToBe.php Normal file
View File

@ -0,0 +1,19 @@
<?php
use PHPUnit\Framework\ExpectationFailedException;
test('strict comparisons', function () {
$nuno = new stdClass();
$dries = new stdClass();
expect($nuno)->toBe($nuno);
expect($nuno)->not->toBe($dries);
});
test('failures', function () {
expect(1)->toBe(2);
})->throws(ExpectationFailedException::class);
test('not failures', function () {
expect(1)->not->toBe(1);
})->throws(ExpectationFailedException::class);