Recently I needed to install PHPUnit to write some test for an application I was working on. Here I will describe how I installed it on Ubuntu.
First of all, you’ll need to install PEAR, which provides a distribution system for PHP packages, and is shipped with every release of PHP since version 4.3.0.
apt-get install php5-dev php-pear
Subsequently you’ll install PHPUnit through the PEAR installer. To do that run the following:
pear upgrade PEAR pear config-set auto_discover 1 pear install pear.phpunit.de/PHPUnit
After the installation you can find the PHPUnit source files inside your local PEAR directory; the path is usually /usr/lib/php/PHPUnit.