Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is PHPUnit?

Tags:

php

phpunit

pear

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"

like image 344
speg Avatar asked Jun 18 '11 22:06

speg


2 Answers

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.

like image 59
Jrgns Avatar answered Oct 04 '22 00:10

Jrgns


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'
like image 41
Stephen Avatar answered Oct 04 '22 00:10

Stephen