forked from pestphp/pest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Morten Harders
committed
May 21, 2024
1 parent
303f4c0
commit 55f6b56
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
use PHPUnit\Framework\ExpectationFailedException; | ||
|
||
test('pass', function () { | ||
expect([1, 2, 3])->toBeList(); | ||
expect(['a' => 1, 'b' => 2, 'c' => 3])->not->toBeList(); | ||
}); | ||
|
||
test('failures', function () { | ||
expect(null)->toBeList(); | ||
})->throws(ExpectationFailedException::class); | ||
|
||
test('failures with custom message', function () { | ||
expect(null)->toBeList('oh no!'); | ||
})->throws(ExpectationFailedException::class, 'oh no!'); | ||
|
||
test('not failures', function () { | ||
expect(['a', 'b', 'c'])->not->toBeList(); | ||
})->throws(ExpectationFailedException::class); |