PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, February 14, 2022

[FIXED] phpunit in MAMP pro not working and no errors

 February 14, 2022     mamp, mamp-pro, pear, phpunit     No comments   

Issue

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"

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



Answered By - Martin
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing