8000 [PhpUnitBridge] Also search for composer.phar in git root folder by MaPePeR · Pull Request #34188 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[PhpUnitBridge] Also search for composer.phar in git root folder #34188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2019

Conversation

MaPePeR
Copy link
Contributor
@MaPePeR MaPePeR commented Oct 30, 2019
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.

@@ -99,6 +99,7 @@
$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar')
|| ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`))
|| ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer`) : `which composer 2> /dev/null`))
|| file_exists($COMPOSER = rtrim(`git rev-parse --show-toplevel 2> /dev/null`).DIRECTORY_SEPARATOR.'composer.phar')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use NUL instead of /dev/null on Windows

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In dfd1f18 NUL is used if '\\' === DIRECTORY_SEPARATOR

@nicolas-grekas nicolas-grekas added this to the 4.4 milestone Nov 5, 2019
@nicolas-grekas
Copy link
Member

Thank you @MaPePeR.

nicolas-grekas added a commit that referenced this pull request Nov 5, 2019
…t 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
@nicolas-grekas nicolas-grekas merged commit 97fd204 into symfony:4.4 Nov 5, 2019
@MaPePeR MaPePeR deleted the patch-1 branch November 5, 2019 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0