mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
first
This commit is contained in:
15
tests/Features/AfterAll.php
Normal file
15
tests/Features/AfterAll.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
$file = __DIR__ . DIRECTORY_SEPARATOR . 'after-all-test';
|
||||
|
||||
afterAll(function () use ($file) {
|
||||
unlink($file);
|
||||
});
|
||||
|
||||
test('deletes file after all', function () use ($file) {
|
||||
file_put_contents($file, 'foo');
|
||||
assertFileExists($file);
|
||||
register_shutdown_function(function () use ($file) {
|
||||
assertFileNotExists($file);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user