From 5d1662fb32ebc94f17ddb8d635454a776066733d Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 5 Nov 2024 10:24:24 +0100 Subject: [PATCH] normalize paths to avoid failures if a path is referenced by different names --- Tests/ExecutableFinderTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tests/ExecutableFinderTest.php b/Tests/ExecutableFinderTest.php index 84e5b3c3..c102ab68 100644 --- a/Tests/ExecutableFinderTest.php +++ b/Tests/ExecutableFinderTest.php @@ -123,7 +123,8 @@ 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); @@ -131,7 +132,7 @@ public function testFindBatchExecutableOnWindows() $this->assertFalse(is_executable($target)); - putenv('PATH='.sys_get_temp_dir()); + putenv('PATH='.$tempDir); $finder = new ExecutableFinder(); $result = $finder->find(basename($target), false);