8000 [PhpUnitBridge] fix symlink to bridge in docker by making its path re… · symfony/symfony@3672ee2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3672ee2

Browse files
[PhpUnitBridge] fix symlink to bridge in docker by making its path relative
1 parent 195b673 commit 3672ee2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
}
127127

128128
$oldPwd = getcwd();
129-
$PHPUNIT_DIR = $getEnvVar('SYMFONY_PHPUNIT_DIR', $root.'/vendor/bin/.phpunit');
129+
$PHPUNIT_DIR = rtrim($getEnvVar('SYMFONY_PHPUNIT_DIR', $root.'/vendor/bin/.phpunit'), '/'.\DIRECTORY_SEPARATOR);
130130
$PHP = defined('PHP_BINARY') ? \PHP_BINARY : 'php';
131131
$PHP = escapeshellarg($PHP);
132132
if ('phpdbg' === \PHP_SAPI) {
@@ -238,6 +238,10 @@
238238
$passthruOrFail("$COMPOSER config --unset platform.php");
239239
}
240240
if (file_exists($path = $root.'/vendor/symfony/phpunit-bridge')) {
241+
$p = str_repeat('../', substr_count("$PHPUNIT_DIR/$PHPUNIT_VERSION_DIR", '/', strlen($root))).'vendor/symfony/phpunit-bridge';
242+
if (realpath($p) === realpath($path)) {
243+
$path = $p;
244+
}
241245
$passthruOrFail("$COMPOSER require --no-update symfony/phpunit-bridge \"*@dev\"");
242246
$passthruOrFail("$COMPOSER config repositories.phpunit-bridge path ".escapeshellarg(str_replace('/', \DIRECTORY_SEPARATOR, $path)));
243247
if ('\\' === \DIRECTORY_SEPARATOR) {

0 commit comments

Comments
 (0)
0