Recommended Way for Test
It is the recommended way to quickly give a try to this plugin. Indeed, since version 1.2, all the external tools (PHP Depend, PHPMD, etc.) are shipped with the plugin and thus, no longer need to be installed separately.
The only prerequisite then is to install PHP version 5.3.3 or newer (actually, version 5.4.7 or later is recommended for PHPUnit 3.7). You can download PHP at this location and follow the instructions to install it.
Versions of the external tools embedded as PHAR in the plugin:
Note that you will not be able to run the computation of coverage by unit tests, but only reuse existing reports, with this installation mode.
Recommended Way for Production Environment
It is the recommended way for a production environment as you can install your own version of each external tool.
You have to be logged in as an administrator to run the commands below.
- Install PHP. You can download PHP at this location and follow the instructions to install it.
Install PEAR. To ensure PEAR version and to upgrade it, type the following commands in command prompt:
If you, for some reason, need the latest PEAR and the commands above don't get it then download http://pear.php.net/go-pear.phar and execute it with php (don't use the old go-pear without the .phar extension, it will likely fail):
Install PHPUnit from pear using the following command lines:
- Install XDebug to allow code instrumentation used for instance by PHP Unit to compute coverage.
If you are running Linux or Mac, you must install phpize and php headers (normally found in php dev packages) and then compile xdebug via pecl:
Another example on Fedora 18:
And then edit your $PHP_HOME/php.ini file to add the following line:
If you are running Windows, you should download the binary version matching your PHP installation from this location. And then edit your $PHP_HOME/php.ini file to add the following line:
Install PHP Depend: