Skip to content

Commit

Permalink
A new fix in test
Browse files Browse the repository at this point in the history
  • Loading branch information
rosven9856 committed Oct 8, 2024
1 parent 8aff833 commit aad99f5
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions tests/ActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,28 +64,25 @@ private function removeDirectory(string $dir): void
{
$dir = realpath($dir);

if (is_dir($dir) && is_readable($dir) && is_writable($dir)) {
$iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($dir),
\RecursiveIteratorIterator::CHILD_FIRST,
);

$iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($dir),
\RecursiveIteratorIterator::CHILD_FIRST,
);
foreach ($iterator as $path) {

foreach ($iterator as $path) {

if (!$path instanceof \SplFileInfo) {
continue;
}

if ($path->isDir()) {
rmdir((string) $path);
} else {
unlink((string) $path);
}
if (!$path instanceof \SplFileInfo) {
continue;
}

rmdir($dir);
if ($path->isDir()) {
rmdir((string) $path);
} else {
unlink((string) $path);
}
}

rmdir($dir);
}

public function testBuildComposerPackage(): void
Expand Down

0 comments on commit aad99f5

Please sign in to comment.