mirror of
https://github.com/pestphp/pest.git
synced 2026-03-09 17:27:22 +01:00
feat(expect): add more methods
This commit is contained in:
17
tests/Expect/thatDirectoryExists.php
Normal file
17
tests/Expect/thatDirectoryExists.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
test('pass', function () {
|
||||
$temp = sys_get_temp_dir();
|
||||
|
||||
expect($temp)->toBeExistingDirectory();
|
||||
});
|
||||
|
||||
test('failures', function () {
|
||||
expect('/random/path/whatever')->toBeExistingDirectory();
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
test('not failures', function () {
|
||||
expect('.')->not->toBeExistingDirectory();
|
||||
})->throws(ExpectationFailedException::class);
|
||||
Reference in New Issue
Block a user