Installing PHPUnit under MAMP can be a bit of a hassle. Here's what I did to install phpunit 3.6.11 under MAMP Pro 2.0.5.
/Applications/MAMP/bin/php/php5.2.17/bin
. You'll want to install your PHPUnit there. mv /Applications/MAMP/bin/php/php5.2.17/conf/pear.conf /Applications/MAMP/bin/php/php5.2.17/conf/pear.conf.bak
/Applications/MAMP/bin/php/php5.2.17/bin/pear channel-update pear.php.net /Applications/MAMP/bin/php/php5.2.17/bin/pear upgrade pear
This should upgrade you to PEAR 1.9.4, or possibly a newer version.
/Applications/MAMP/bin/php/php5.2.17/bin/pear channel-discover pear.phpunit.de /Applications/MAMP/bin/php/php5.2.17/bin/pear channel-discover pear.symfony.com /Applications/MAMP/bin/php/php5.2.17/bin/pear channel-discover components.ez.no
/Applications/MAMP/bin/php/php5.2.17/bin/pear install phpunit/PHPUnit
/Applications/MAMP/bin/php/php5.2.17/bin/phpunit --version
phpunit
in my path:sudo ln -s /Applications/MAMP/bin/php/php5.2.17/bin/phpunit /usr/local/bin/phpunit
That's it! If you have any questions or suggestions for improvements, post in the comments.