Skip to content

Commit 5d1662f

Browse files
committed
normalize paths to avoid failures if a path is referenced by different names
1 parent 0190687 commit 5d1662f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Tests/ExecutableFinderTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,16 @@ public function testFindBatchExecutableOnWindows()
123123
$this->markTestSkipped('Can be only tested on windows');
124124
}
125125

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

128129
try {
129130
touch($target);
130131
touch($target.'.BAT');
131132

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

134-
putenv('PATH='.sys_get_temp_dir());
135+
putenv('PATH='.$tempDir);
135136

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

0 commit comments

Comments
 (0)