But seriously, it was not working, for me at least. Following the Pear instructions given , I wasn’t seeing any specific error at times. But commands like ‘which phpunit’ or ‘phpunit –version’ would generate errors. After going through links like http://stackoverflow.com/questions/1528717/phpunit-require-once-error and the ubuntu forum. I realized I should be installing PHP_CodeCoverage. Which after done, the error: (When asked for phpunit –version)
Call to undefined method PHP_CodeCoverage_Filter::getInstance() in /usr/bin/phpunit on line 39
After several hours of investigation, I finally realized the trouble was in the pear package, it was most definitely not configured properly.
Configuring PEAR package:
sudo pear config-set bin_dir /usr/bin
sudo pear config-set doc_dir /usr/share/php/doc
sudo pear config-set php_dir /usr/share/php
sudo pear config-set cfg_dir /usr/share/php/cfg
sudo pear config-set data_dir /usr/share/php/data
sudo pear config-set test_dir /usr/share/php/test
$ sudo pear uninstall phpunit/PHPUnit
$ sudo pear install phpunit/PHPUnit
And here's the successful installation test :
$ which phpunit
/some/path/to/bin/phpunit
$ phpunit --version
PHPUnit A.B.C by Sebastian Bergmann.
Yeah.. so this is it! :-)