Andrew Havens Ruby Developer

Getting started with Zend_Test – Step 2: Setting up PHPUnit on Mac OS X 10.5 (Leopard)

19 November 2010

Question: How do I get started using ZendTest? What is the process necessary to start using ZendTest for testing my Zend Framework application?

Answer: Zend_Test extends PHPUnit. Therefore, we need to start by installing PHPUnit. The easiest way to install PHPUnit is by installing PEAR. If you’ve compled step one in this series, you’re all set! If you don’t already have PEAR set up, you should go back and read Step one: setting up PEAR. You will soon see why PEAR makes PHPUnit so easy to install.

So now that we have PEAR all ready to go, all we have to do is add the PHPUnit channel to PEAR’s known channels. But first, let’s start by switching to the super user, so we don’t have to keep entering our password.

sudo su -

Next, we tell PEAR to discover the PHPUnit channel:

sudo pear channel-discover pear.phpunit.de

Now all we have to do is tell pear to install PHPUnit, and we’re done!

pear install phpunit/PHPUnit