Search code examples
phpmacosphpunitpearosx-mavericks

Install PHPUnit on OSX Mavericks


I'm trying to install PHPUnit on my MBP with OSX Mavericks. The install part is going great, pear throws no errors, exceptions or whatsoever. But when I try to execute the phpunit command in terminal it does throw an error.

I've searched far and wide for an answer, but I can't find anything that solves the problem.

This is what happens:

  • Installing PHPUnit (pear install phpunit/PHPUnit) it's saying it's already installed (that's correct).
  • When I list all the installed packages in pear (pear list), PHPUnit does not show up in the list.
  • When I execute the pear list-all command it shows up twice as PHPUNIT (which is version 1.3.2) and PHPUNIT2 (version 2.3.6).
  • And when I try to execute the phpunit command it throws an error (twice):

PHP Fatal error: require_once(): Failed opening required 'File/Iterator/Autoload.php' (include_path='.:') in /usr/local/pear/share/pear/PHPUnit/Autoload.php on line 64

Terminal Output

EDIT: I had it working on Mountain Lion, but since I've upgraded to Mavericks phpunit was broken. Also, I've checked the directory of the autoload.php, and the file is there..

Can somebody please explain what's going on? It's starting to drive me mad..


Solution

  • The solution was to use the IDE PHPStorm and Composer. Which gives the advantage to install dependencies on a project base.

    Thanks to Paves S. for the recommendation.

    For more information on how to install:

    http://www.jetbrains.com/phpstorm/webhelp/enabling-phpunit-support.html