The accepted answer works when installing phpunit 3.4, but if you want to install phpunit 3.5 (which can also be used for unit test in the Zend project, although not all Zends tests can pass), you should follow a slightly different path. You will need to install the dependencies for phpunit 3.5 separately before installing phpunit, otherwise some of the dependencies will simply force you to install phpunit 3.6:
Install first (note the -f option, which forces the installation of a specific version):
sudo pear install -f
Then follow the instructions in the link of the accepted answer to change the path of inclusion and correctly designate the link.
Jens wegar
source share