Created
December 24, 2016 04:36
-
-
Save lazyguru/10208fc8f1b7e6cdeaf5d03a6f06782c to your computer and use it in GitHub Desktop.
Always run the correct version of phpunit for each project. Add this to ~/bin/phpunit and ensure ~/bin is at the beginning of your PATH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ -f vendor/bin/phpunit ]; then | |
vendor/bin/phpunit $@ | |
exit $? | |
fi | |
if [ -f ~/.composer/vendor/bin/phpunit ]; then | |
~/.composer/vendor/bin/phpunit $@ | |
exit $? | |
fi | |
if [ -f /usr/local/bin/phpunit ]; then | |
/usr/local/bin/phpunit $@ | |
exit $? | |
fi | |
echo "I'm out of ideas. Can't find phpunit anywhere. Maybe you should 'composer global require phpunit/phpunit'" | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment