mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
feat(expectations): add toMatchConstraint
This commit is contained in:
16
tests/Expect/toMatchConstraint.php
Normal file
16
tests/Expect/toMatchConstraint.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\Constraint\IsTrue;
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
test('pass', function () {
|
||||
expect(true)->toMatchConstraint(new IsTrue());
|
||||
});
|
||||
|
||||
test('failures', function () {
|
||||
expect(false)->toMatchConstraint(new IsTrue());
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
test('not failures', function () {
|
||||
expect(true)->not->toMatchConstraint(new IsTrue());
|
||||
})->throws(ExpectationFailedException::class);
|
||||
Reference in New Issue
Block a user