diff --git a/src/Composer/Installer/BinaryInstaller.php b/src/Composer/Installer/BinaryInstaller.php index 12afb168aabe..2f8b04f052b6 100644 --- a/src/Composer/Installer/BinaryInstaller.php +++ b/src/Composer/Installer/BinaryInstaller.php @@ -265,6 +265,11 @@ protected function generateUnixyProxyCode($bin, $link) 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]) !== '