Testing the Plugin
It This is the recommended way to quickly give a try to this plugin. Indeed, since installation method recommended for your initial tests with the plugin because it requires the least effort.
Since version 1.2, all the external tools (PHP Depend, PHPMD, etc.) used by the plugin are shipped with the plugin and thus, no longer need to be installed separatelyit.
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 locationhere or there, 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 reportreports, with this installation mode.
method for Production
It This is the recommended way installation method for a production environment as environments because you can install your own version of each external tool.
- Install PHP. You can download PHP at this location and or this one and follow the instructions to install it.
Install PEAR. To ensure PEAR version and to upgrade it, type the following commands in command prompt:
pear version pear upgrade pear
If you, for some reason, reasons you need the latest PEAR and the commands above don't get retrieve it then , you can 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:
pear channel-discover pear.phpunit.de pear channel-discover pear.symfony.com pear install phpunit/PHPUnit-X.Y.Z
- Install XDebug to allow code instrumentation used for instance by PHP Unit to compute coverage.
If you are running a Linux or Mac OS, you must install phpize and php headers (normally found in php dev packages) and then compile xdebug via pecl:
apt-get install make apt-get install php5-dev pecl install xdebug
Another example on Fedora 18:
yum install make yum install php-devel pecl install xdebug
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:
pear channel-discover pear.pdepend.org pear install pdepend/PHP_Depend-X.Y.Z
pear channel-discover pear.phpmd.org pear install --alldeps phpmd/PHP_PMD-X.Y.Z
pear install PHP_CodeSniffer-X.Y.Z