speg
speg

Reputation: 2019

Where is PHPUnit?

Resolved!

I uninstalled phpunit from pear and then reinstalled it again. I believe I was using the wrong/old/not enough sources before installing. Works like a charm!


So I'm trying to set up PEAR & PHPUnit. I was following http://www.newmediacampaigns.com/page/install-pear-phpunit-xdebug-on-macosx-snow-leopard but after I installed pear I had a different directory structure in /usr/local. Regardless, I was able run the phpunit install. But now I'm lost and asking for help before I make a bigger mess :)

pear config-show says:

PEAR directory                 php_dir          /usr/local/share/pear

And my php.ini file (and confirmed in phpinfo() says:

include_path=".:/usr/local/share/pear"

So that's good, right? But now what? I get

Failed opening required 'PHPUnit/Framework.php' (include_path='.:/usr/local/share/pear')

If I try to include it in the php. And I have no idea where the binary might be to run it from the command line.

Inside /usr/local/share/pear/PHPUnit there are two directories "Extensions" and "Framework"

Upvotes: 5

Views: 9537

Answers (2)

Stephen
Stephen

Reputation: 3432

Check for a bin directory in the pear install, something along the lines of /usr/local/share/pear/bin/ - your install is different than mine..

You could also try searching for the binary -

find /usr/local/share/pear -name 'phpunit'

Upvotes: 3

Jrgns
Jrgns

Reputation: 25188

It sometimes happen that the install fails on PHPUnit specifically, but succeeds on the dependencies, so it only looks like the install was succesfull.

Try this when installing

pear install --force --alldeps phpunit/PHPUnit

The --force option will force the install of PHPUnit, even if all the dependencies can't be met. In my case there was a missing dependency for the dom PHP extension which blocked the installation even though the PHP_Invoker package could be used instead.

The --alldeps option makes sure that all of the dependencies got installed.

Upvotes: 6

Related Questions