first, read the following Link:
http://kubyshkin.ru/posts/phpunit-on-mac-os-x-snow-leopard-10-6.html
Then if you get problem with symfony/YAML version conflict like:
phpunit/PHPUnit requires package „symfony/YAML“ (version >= 1.0.2, version <= 1.0.2), installed version is 1.0.6
No valid packages found
install failed
Just uninstall it with:
sudo pear uninstall symfony/YAML
uninstall ok: channel://pear.symfony-project.com/YAML-1.0.6
then install old version like this:
sudo pear install symfony/YAML-1.0.2
downloading YAML-1.0.2.tgz …
Starting to download YAML-1.0.2.tgz (9,299 bytes)
…..done: 9,299 bytes
install ok: channel://pear.symfony-project.com/YAML-1.0.2
Now you can install PHPUnit :
sudo pear install phpunit/PHPUnit
downloading PHPUnit-3.6.12.tgz …
Starting to download PHPUnit-3.6.12.tgz (120,240 bytes)
……………………..done: 120,240 bytes
install ok: channel://pear.phpunit.de/PHPUnit-3.6.12
Now to check phpunit
phpunit –version
PHPUnit 3.6.12 by Sebastian Bergmann.
Done!