Skip to content

Commit

Permalink
Add workaround for PHPUnit process isolation combined with bin proxies,
Browse files Browse the repository at this point in the history
fixes #10387
  • Loading branch information
Seldaek committed Dec 23, 2021
1 parent 4060758 commit 7d1ca1f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Composer/Installer/BinaryInstaller.php
Expand Up @@ -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";

This comment has been minimized.

Copy link
@johnstevenson

johnstevenson Dec 23, 2021

Member

Shouldn't these be array(realpath('.$binPathExported.'));

This comment has been minimized.

Copy link
@Seldaek

Seldaek Dec 23, 2021

Author Member

Yes yes absolutely, good catch. c1c6698

}
if (trim($match[0]) !== '<?php') {
$streamHint = ' using a stream wrapper to prevent the shebang from being output on PHP<8'."\n *";
$streamProxyCode = <<<STREAMPROXY
Expand Down

0 comments on commit 7d1ca1f

Please sign in to comment.