In this recipe, we'll see how to install and setup the popular PHPUnit testing package: PHPUnit.
For this recipe, we need a working installation of Laravel 4. We'll also need the Composer dependency tool installed from http://getcomposer.org.
To complete this recipe, follow the given steps:
In the root directory of the application, add the following line to the
composer.json
file:"require-dev": { "phpunit/phpunit": "3.7.*" },
Open the command line window, navigate to the root directory, and run an update on the Composer tool with the following line:
php composer update
After it is installed, run a quick test in the command line window with the command:
vendor/bin/phpunit