Skip to content
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

Find phpunit in vendor bin directory #123

Merged
merged 1 commit into from
Dec 14, 2017
Merged

Find phpunit in vendor bin directory #123

merged 1 commit into from
Dec 14, 2017

Conversation

francoispluchino
Copy link
Collaborator

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #99
License MIT
Doc PR ~

This PR allow to use Phpunit installed in the ./vendor/bin directory in addition of the directories:

  • ./bin
  • ~/.composer/vendor/bin (unix)
  • %APPDATA%\Composer\vendor\bin (windows)
  • Or all Phpunit binary defined in the PATH variables

@@ -79,7 +79,9 @@ private static function isWindows()

private static function getWindowsBinCmd()
{
if (file_exists(getcwd().'/bin/phpunit')) {
if (file_exists(getcwd().'/vendor/bin/phpunit')) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you "exit early" there?

Something like

if (file_exists(getcwd().'/vendor/bin/phpunit')) {
  return 'vendor\bin\phpunit {}';
}

if (file_exists(getcwd().'/bin/phpunit')) {
  return $cmd = 'bin\phpunit {}';
}

....

return $cmd = 'phpunit {}';

To me is more elegant and readable. WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No problem, if you prefer like that

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's done.

@DonCallisto DonCallisto merged commit a6d46c4 into liuggio:master Dec 14, 2017
@DonCallisto
Copy link
Collaborator

Thanks

@francoispluchino francoispluchino deleted the phpunit-vendor-dir branch December 14, 2017 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants