How to install phpunit 3.5 on mac using MAMP

I am trying to install PHPUnit 3.5 on Mac OS X using MAMP. I have installed PHPUnit 3.5 via PEAR from MAMP. This is all correct and phpunit is located in / Applications / MAMP / bin / php 5.3 / lib / php / PEAR / PHPUnit. The executable is located in / Applications / MAMP / bin / php 5.3 / bin /.

But when I want to execute phpunit it does nothing, even when I execute it in the MAMP php bin folder.

Can anyone help me with this?


which phpunit: /Applications/MAMP/bin/php5.3/bin//phpunit

which pear: /Applications/MAMP/bin/php5.3/bin//pear

pear list Installed packages, channel:

Package version status

Archive_Tar 1.3.7 stable

Console_Getopt 1.2.3 stable

PEAR 1.9.1 stable

Structures_Graph 1.0.3 stable

XML_Util 1.2.1 stable

Phpunit content


require_once 'PHP/CodeCoverage/Filter.php';
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'PHPUNIT');

if (extension_loaded('xdebug')) {

if (strpos('/Applications/MAMP/bin/php5.3/bin/php', '@php_bin') === 0) {
    set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path());

require_once 'PHPUnit/Autoload.php';

define('PHPUnit_MAIN_METHOD', 'PHPUnit_TextUI_Command::main');




source to share

2 answers

What is the output which phpunit

and which pear

and pear list


Also have you installed phpunit with the option --alldeps




I managed to install PHPUnit from XAMPP on Mac, but it took me a while.

One trick was to edit the phpunit script to set it up to use the XAMPP (or MAMP) PHP executable and not the default Mac.



All Articles