5

I'm trying to set up PHPunit in a Laravel project (which is being running in a Linux VM using Vagrant and VirtualBox). I've added PHPunit to composer.json and run composer install and composer update, and yet nothing is working. Running phpunit from the command line does nothing. (Nor does php phpunit or php phpunit.phar.)

How do I get PHPunit to run my tests?

2 Answers 2

17

You must now run it using:

vendor/bin/phpunit
0
4

Install phpunit globally and then can you can use it with just phpunit command in your local project instead of vendor/bin/phpunit (your composer/vendor/bin has to be in system path)

composer global require phpunit/phpunit

or you can add following alias in your VM and then you can run it within your project directory with just phpunit command

alias phpunit='vendor/bin/phpunit'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.