mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
24 lines
568 B
PHP
24 lines
568 B
PHP
<?php
|
|
|
|
use PHPUnit\Framework\ExpectationFailedException;
|
|
|
|
beforeEach(function () {
|
|
touch($this->tempFile = sys_get_temp_dir() . '/fake.file');
|
|
});
|
|
|
|
afterEach(function () {
|
|
unlink($this->tempFile);
|
|
});
|
|
|
|
test('pass', function () {
|
|
expect($this->tempFile)->toBeReadableFile();
|
|
});
|
|
|
|
test('failures', function () {
|
|
expect('/random/path/whatever.file')->toBeReadableFile();
|
|
})->throws(ExpectationFailedException::class);
|
|
|
|
test('not failures', function () {
|
|
expect($this->tempFile)->not->toBeReadableFile();
|
|
})->throws(ExpectationFailedException::class);
|