Skip to content

Commit

Permalink
fix src directory created too early
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmuffme committed Feb 1, 2024
1 parent 5675c6d commit e58667e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/EndToEnd/PsalmEndToEndTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
use function tempnam;
use function unlink;

use const DIRECTORY_SEPARATOR;

/**
* Tests some of the most important use cases of the psalm and psalter commands, by launching a new
* process as if invoked by a real user.
Expand All @@ -47,8 +49,6 @@ public static function setUpBeforeClass(): void
throw new Exception('Couldn\'t get working directory');
}

mkdir(self::$tmpDir . '/src');

copy(__DIR__ . '/../fixtures/DummyProjectWithErrors/composer.json', self::$tmpDir . '/composer.json');

$process = new Process(['composer', 'install', '--no-plugins'], self::$tmpDir, null, null, 120);
Expand All @@ -63,6 +63,8 @@ public static function tearDownAfterClass(): void

public function setUp(): void
{
mkdir(self::$tmpDir . '/src');

copy(
__DIR__ . '/../fixtures/DummyProjectWithErrors/src/FileWithErrors.php',
self::$tmpDir . '/src/FileWithErrors.php',
Expand Down Expand Up @@ -281,7 +283,7 @@ private static function recursiveRemoveDirectory(string $src): void
$dir = opendir($src);
while (false !== ($file = readdir($dir))) {
if (($file !== '.') && ($file !== '..')) {
$full = $src . '/' . $file;
$full = $src . DIRECTORY_SEPARATOR . $file;
if (is_dir($full)) {
self::recursiveRemoveDirectory($full);
} else {
Expand Down

0 comments on commit e58667e

Please sign in to comment.