Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2a98147

Browse filesBrowse files
bug #43799 [PhpUnitBridge] fix symlink to bridge in docker by making its path relative (nicolas-grekas)
This PR was merged into the 4.4 branch. Discussion ---------- [PhpUnitBridge] fix symlink to bridge in docker by making its path relative | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #40879 | License | MIT | Doc PR | - This is a simpler and less generic version of #40879 that should fit the goal: > When running symfony from a docker container with a volume mapped to the host, it may cause issues when symlinks are generated from container root, as absolute links. > For composer to generate a relative symlink, declaration of the path repository should be relative. Commits ------- 3672ee2 [PhpUnitBridge] fix symlink to bridge in docker by making its path relative
2 parents 195b673 + 3672ee2 commit 2a98147
Copy full SHA for 2a98147

File tree

1 file changed

+5
-1
lines changed
Filter options

1 file changed

+5
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php
+5-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.