8000 minor #34188 [PhpUnitBridge] Also search for composer.phar in git roo… · symfony/symfony@d056c17 · GitHub
[go: up one dir, main page]

Skip to content

Commit d056c17

Browse files
minor #34188 [PhpUnitBridge] Also search for composer.phar in git root folder (MaPePeR)
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- [PhpUnitBridge] Also search for composer.phar in git root folder | Q | A | ------------- | --- | Branch? | 4.4 for features | Bug fix? | kindof | New feature? | addition to existing feature | Deprecations? | no | Tickets | Related: #26637 (comment) | License | MIT When you don't have a system `composer` installation, but a `composer.phar` in the project folder, you cannot use the `simple-phpunit` script from a subfolder of the project with e.g. `../vendor/bin/simple-phpunit`. This change also searches for the `composer.phar` in the current git root folder if it was not found at any other places to increase the likelihood of it being found. Commits ------- 97fd204 [PhpUnitBridge] Also search for composer.phar in git root folder
2 parents dc8bb30 + 97fd204 commit d056c17

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar')
100100
|| ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`))
101101
|| ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer`) : `which composer 2> /dev/null`))
102+
|| file_exists($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? `git rev-parse --show-toplevel 2> NUL` : `git rev-parse --show-toplevel 2> /dev/null`).DIRECTORY_SEPARATOR.'composer.phar')
102103
? $PHP.' '.escapeshellarg($COMPOSER)
103104
: 'composer';
104105

0 commit comments

Comments
 (0)
0