Question

Cannot get phpunit to work, not even when I run phpunit --version nothing is returned in my terminal, no version details and no errors

I am on MAMP Pro 2.1.4 and PHP 5.3.20 I am using MAMP's version of Pear

which pear
/Applications/MAMP/bin/php/php5.3.20/bin/pear

pear -V
PEAR Version: 1.9.4

and

which phpunit
/Applications/MAMP/bin/php/php5.3.20/bin/phpunit

the PHPUnit directory is located in /usr/local/pear/share/pear/PHPUnit/ The actual script that loads Autoload.php is working as I have temporarily added a echo 1; to try it out

php.ini include_path option contains the following

include_path = ".:/Applications/MAMP/bin/php/php5.3.20/lib/php.:/usr/local/pear/share/pear"
Was it helpful?

Solution

Ok finally solved after hours and hours of attempts.

I had to turn display_errors = On in the php.ini version for php CLI

thank to this I managed to get displayed the error which was

Warning: require_once(PHPUnit/Framework/MockObject/Autoload.php): failed to open stream: No such file or directory in /usr/local/pear/share/pear/PHPUnit/Autoload.php on line 67

So I have installed PHPUnit_MockObject

sudo pear install --force phpunit/PHPUnit_MockObject

all working now

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top