Skip to content

Commit

Permalink
[BUGFIX] Make sure test directory can be properly removed
Browse files Browse the repository at this point in the history
  • Loading branch information
eliashaeussler committed Jun 21, 2024
1 parent 48ece67 commit 00c6ac8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/unit/Log/FileLoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
use EliasHaeussler\CacheWarmup as Src;
use PHPUnit\Framework;
use Psr\Log;
use Symfony\Component\Filesystem;

use function dirname;
use function file_exists;
use function file_get_contents;
use function rmdir;
use function sys_get_temp_dir;
use function uniqid;
use function unlink;
Expand Down Expand Up @@ -86,9 +85,10 @@ public function logLogsFormattedMessageToLogFile(): void

protected function tearDown(): void
{
if (file_exists($this->logFile)) {
unlink($this->logFile);
rmdir(dirname($this->logFile));
}
// Run subject destruction to close log file stream
unset($this->subject);

$filesystem = new Filesystem\Filesystem();
$filesystem->remove(dirname($this->logFile));
}
}

0 comments on commit 00c6ac8

Please sign in to comment.