feat(expect): add more methods

This commit is contained in:
ceceppa
2020-07-16 07:34:43 +01:00
parent 1e61144cd2
commit f0f79ab244
5 changed files with 110 additions and 3 deletions

View File

@ -0,0 +1,15 @@
<?php
use PHPUnit\Framework\ExpectationFailedException;
test('pass', function () {
expect(sys_get_temp_dir())->toBeWritableDirectory();
});
test('failures', function () {
expect('/random/path/whatever')->toBeWritableDirectory();
})->throws(ExpectationFailedException::class);
test('not failures', function () {
expect(sys_get_temp_dir())->not->toBeWritableDirectory();
})->throws(ExpectationFailedException::class);