Skip to content

Commit

Permalink
normalize paths to avoid failures if a path is referenced by differen…
Browse files Browse the repository at this point in the history
…t names
  • Loading branch information
xabbuh committed Nov 6, 2024
1 parent 0190687 commit 5d1662f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Tests/ExecutableFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,16 @@ public function testFindBatchExecutableOnWindows()
$this->markTestSkipped('Can be only tested on windows');
}

$target = str_replace('.tmp', '_tmp', tempnam(sys_get_temp_dir(), 'example-windows-executable'));
$tempDir = realpath(sys_get_temp_dir());
$target = str_replace('.tmp', '_tmp', tempnam($tempDir, 'example-windows-executable'));

try {
touch($target);
touch($target.'.BAT');

$this->assertFalse(is_executable($target));

putenv('PATH='.sys_get_temp_dir());
putenv('PATH='.$tempDir);

$finder = new ExecutableFinder();
$result = $finder->find(basename($target), false);
Expand Down

0 comments on commit 5d1662f

Please sign in to comment.