tags:

views:

74

answers:

2

Hi All,

I'm trying to install PHPUnit 3.5 on Mac OS X with MAMP. I did install PHPUnit 3.5 via PEAR of MAMP. This is all correctly and phpunit is located /Applications/MAMP/bin/php5.3/lib/php/PEAR/PHPUnit. The executable is located in /Applications/MAMP/bin/php5.3/bin/.

But when I want to execute phpunit it doesn't do anything, even when I do execute it in the bin folder of MAMP php.

Can somebody help me with this?

Update

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

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

pear list Installed packages, channel pear.php.net:

Package Version State

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

Content of phpunit

#!/Applications/MAMP/bin/php5.3/bin/php
<?php

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

if (extension_loaded('xdebug')) {
    xdebug_disable();
}

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');

PHPUnit_TextUI_Command::main();
+1  A: 

What is the output of which phpunit and which pear and pear list?

Also did you install phpunit with the --alldeps option?

Kayla Rose
Hi added the results to my post. I did indeed used --alldeps
Skelton
What do you mean by "not doing anything"? Try just running 'phpunit' wihtout any arguments. Does it output the manual?
Kayla Rose
It doesn't output anything
Skelton
Hmm. I'm stumped then. It's weird that it's recognized by which, but you can actually run it. Did you check your log files to see if any php errors are occuring?
Kayla Rose
It can't find require_once 'PHP/CodeCoverage/Filter.php'; as this is located in Applications/MAMP/bin/php5.3/lib/php/PEAR
Skelton
Is the PEAR directory included in your include paths in php.ini? If not add it and restart apache. If that doesn't work, you may want to to try explicitly adding the location of the PHPUnit library to your include_path. (e.g include_path = ".:/Applications/MAMP/bin/php5/lib/php:/Applications/MAMP/bin/php5/lib/php/PEAR/PHPUnit" #Or wherever it's located on your machine)
Kayla Rose
Thx that worked.
Skelton
A: 

I succeeded in installing PHPUnit with XAMPP on Mac, but it took me some time.

One of the trick was to edit the phpunit script to configure it to use XAMPP (or MAMP) PHP executable, and not the default one on Mac.

Matthieu
My php executable is symlinked to the one of MAMP. So I'm using the correct one.
Skelton