From 7d1ca1f56d81e7641e4c5b7716472c582e3841a6 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 23 Dec 2021 12:38:35 +0100 Subject: [PATCH] Add workaround for PHPUnit process isolation combined with bin proxies, fixes #10387 --- src/Composer/Installer/BinaryInstaller.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Composer/Installer/BinaryInstaller.php b/src/Composer/Installer/BinaryInstaller.php index 12afb168a..2f8b04f05 100644 --- a/src/Composer/Installer/BinaryInstaller.php +++ b/src/Composer/Installer/BinaryInstaller.php @@ -265,6 +265,11 @@ class BinaryInstaller if ($this->vendorDir) { $autoloadPathCode = '$GLOBALS[\'_composer_autoload_path\'] = ' . $this->filesystem->findShortestPathCode($link, $this->vendorDir . '/autoload.php', false, true).";\n"; } + // Add workaround for PHPUnit process isolation on PHPUnit 6+ + if ($this->filesystem->normalizePath($bin) === $this->filesystem->normalizePath($this->vendorDir.'/phpunit/phpunit/phpunit')) { + $autoloadPathCode .= '$GLOBALS[\'__PHPUNIT_ISOLATION_EXCLUDE_LIST\'] = [realpath('.$binPathExported.')];'."\n" + .'$GLOBALS[\'__PHPUNIT_ISOLATION_BLACKLIST\'] = [realpath('.$binPathExported.')];'."\n"; + } if (trim($match[0]) !== '