phpunit-bin - run phpunit from anywhere
These days it’s common for projects to supply phpunit via
of my projects do this, and this means that every project supplies their own
I live on the command-line and it can be a bit annoying to invoke the correct
phpunit script every time.
So I wrote a small script that is installable globally, and it will:
- Automatically scan your directory and parents to find
- Based on that find the correct
- Try to find
chdirinto that directory.
- Run your local
If this is useful to you, you can install it via composer:
composer global require evert/phpunit-bin
Make sure that the composer global vendor dir is part of your
After that, you can just run
phpunit from wherever you are in your project