Installing PHPUnit on Mac OS 10.7 w/ MAMP

Not use to Mac stuff so spent quite a bit of time to setup PHPUnit. Trying to setup PHPUnit w/ the Zend Framework 1.X locally on the Mac. For Zend 1.x it officially only support PHP 5.4.x.

This guide was the most helpful:

http://jeffreybarke.net/2010/08/how-to-install-phpunit-with-mamp/

sudo /Applications/MAMP/bin/php/php5.4.19/bin/pear channel-discover pear.phpunit.de

sudo /Applications/MAMP/bin/php/php5.4.19/bin/pear channel-discover pear.symfony.com

sudo /Applications/MAMP/bin/php/php5.4.19/bin/pear install phpunit/PHPUnit

Also had to update the system env PATH to the php from MAMP
PATH=/Applications/MAMP/bin/php/php5.4.19/bin:$PATH
or
cp /Applications/MAMP/bin/php/php5.4.19/bin/phpunit /usr/local/bin/phpunit

If you see it complain about:
phpunit not found in your include path

then you are not point to the correct php and that’s why you need to update the PATH

Super Basic Overview of PHPUnit:
http://www.sitepoint.com/tutorial-introduction-to-unit-testing-in-php-with-phpunit/

Advertisements
This entry was posted in Web and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s