Install PHPUnit:
Let’s try to install with normal apt-get command
raj@GeekSIte ~ $ sudo apt-get install phpunit
Confirm the version of PHPUnit.
raj@GeekSIte:~$ phpunit --version
PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38
PHP Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/bin/phpunit on line 38
From the above you can understand the issue, with the PEAR we can resolve the issue. Upgrade the PEAR if necessary.
raj@GeekSIte ~ $ sudo pear upgrade pear
Install the dependencies using PEAR package.
raj@GeekSIte ~ $ sudo pear channel-discover pear.phpunit.de
raj@GeekSIte ~ $ sudo pear channel-discover components.ez.no
raj@GeekSIte ~ $ sudo pear channel-discover pear.symfony-project.com
raj@GeekSIte ~ $ sudo pear install --alldeps phpunit/PHPUnit
Verify that It Works!.
raj@GeekSIte ~ $ phpunit --version
PHPUnit 3.6.10 by Sebastian Bergmann.
That’s all!