Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPUnit CLI not available after PEAR install

I've installed PHPUnit on my OS X Snow Leopard box using the following command:

sudo pear channel-discover pear.phpunit.de
sudo pear install phpunit/PHPUnit

I would expect that the phpunitCLI command would be available after that, but it isn't. I've looked in /usr/local/bin and /usr/lib/php/PHPUnit but can't find anything that looks like a CLI.

Can anyone tell me how to get the CLI up and running?

like image 984
phidah Avatar asked Dec 04 '10 09:12

phidah


2 Answers

I had the same problem, I received no errors after the pear installation, but some directories and files where installed (under /usr/lib/php/pear) and others missing (I had no phpunit.sh file among others).

My setup: OSX Lion 10.7.2 + PHP 5.3.6 + PEAR 1.9.2.

I can't really say for sure what the problem was, but I found that the PEAR installer was not up to date, so I upgraded it (to 1.9.4) with:

sudo pear upgrade pear

After that, following the phpunit manual, I typed:

sudo pear config-set auto_discover 1

So yo don't need to add the channels for every package and dependency. And then:

sudo pear install --alldeps pear.phpunit.de/PHPUnit

And voilà, everything is working finally!

like image 122
AJJ Avatar answered Sep 20 '22 07:09

AJJ


I had the same problem, after checking installation page and running below commands, it started working. Just make sure to remove it before running them.

sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover components.ez.no
sudo pear channel-discover pear.symfony-project.com
sudo pear install phpunit/PHPUnit
like image 34
David Kuridža Avatar answered Sep 22 '22 07:09

David Kuridža