From 0879e80d56f5a0f5df63f5f3dc2b133aeaf52083 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 9 Mar 2021 09:54:06 +0100 Subject: [PATCH] Fix functional tests to use the same PHP version as PHPUnit runs with --- tests/Composer/Test/AllFunctionalTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Composer/Test/AllFunctionalTest.php b/tests/Composer/Test/AllFunctionalTest.php index c29b4f279..75f942c1a 100644 --- a/tests/Composer/Test/AllFunctionalTest.php +++ b/tests/Composer/Test/AllFunctionalTest.php @@ -78,7 +78,7 @@ class AllFunctionalTest extends TestCase } } - $proc = new Process('php -dphar.readonly=0 '.escapeshellarg('./bin/compile'), $target); + $proc = new Process((defined('PHP_BINARY') ? escapeshellcmd(PHP_BINARY) : 'php').' -dphar.readonly=0 '.escapeshellarg('./bin/compile'), $target); $exitcode = $proc->run(); if ($exitcode !== 0 || trim($proc->getOutput())) { @@ -110,7 +110,7 @@ class AllFunctionalTest extends TestCase 'COMPOSER_CACHE_DIR' => $this->testDir.'cache', ); - $cmd = 'php '.escapeshellarg(self::$pharPath).' --no-ansi '.$testData['RUN']; + $cmd = (defined('PHP_BINARY') ? escapeshellcmd(PHP_BINARY) : 'php') .' '.escapeshellarg(self::$pharPath).' --no-ansi '.$testData['RUN']; $proc = new Process($cmd, $this->testDir, $env, null, 300); $output = '';