Setting up PHPUnit on OSX
We can install it using Homebrew
$ brew install phpunit
To install via terminal:
curl https://phar.phpunit.de/phpunit.phar -L -o phpunit.phar
chmod +x phpunit.phar
mv phpunit.phar /usr/local/bin/phpunit
Via homebrew (only if you've installed php via homebrew as well):
brew tap josegonzalez/php
brew install phpunit
Ahhh.... OK ... I think I might have gotten it working now.
the answer was present in the PHPUnit documentation. http://www.phpunit.de/manual/3.4/en/installation.html
After the installation you can find the PHPUnit source files inside your local PEAR directory; the path is usually /usr/lib/php/PHPUnit.
The Mac version of PEAR that I was running, did install PHPUnit if I ran all the commands listed under the "SUDO" user eg:
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover pear.symfony-project.com
sudo pear upgrade-all
At this point, all the files are downloaded to /usr/local/pear but the command
phpunit
is looking to include files from /usr/lib/php/PHPUnit The solution? To copy the PHPUnit folder from
cp /usr/lib/pear/PHPUnit /usr/lib/php
OR
make a symlink
cd /usr/lib/php
ln -s /usr/lib/pear/PHPUnit PHPUnit
I've seen a lot of people with similar problems, but this particular solution hadn't come up in any of the threads I've seen. Hopefully of use to you :) -Alex