Installing PHPUnit with composer globally seems more convenient to me for those two reasons:
1. Using it everywhere without needing an extra install.
2. Just running phpunit
instead of vendor/bin/phpunit
(using an alias might solve this)
Are there any reasons why a local install might be the better choice? For example: using the exact same versions every time. (don't have a lot of experience with PHPUnit, so not sure if this really is an issue or not)
The big disadvantage of installing packages globally is that you might end up with different versions of PHPUnit
between developers in your team (unless you are the only developer). This might cause some side effects.
If you install it locally using composer.json
, then every developer in your team will have exactly the same version as you do for that specific application. Also, everybody will see when you change the version in composer.json
.
If you don't like typing vendor/bin/phpunit
, you can use Makefile
(which is also in your project):
test:
vendor/bin/phpunit --configuration=test/Unit/phpunit.xml
then run it ...
make test
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With