feat(expect): add more methods

This commit is contained in:
ceceppa
2020-07-13 17:38:09 +01:00
parent 9f62f2d483
commit b4bf799d75
4 changed files with 36 additions and 23 deletions

View 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);