0
votes

I'm trying to configure CodeIgniter with PHPUnit using CIUnit fork from Kenjis: my-ciunit I think I've done a lot more than needed installing PHPUnit :-S it was my first time and possibly I've made ​​some mistakes.

When I execute phpunit . on a NON CodeIgniter project with a simple PHPUnit test, php works perfectly. But when I execute it on 'tests' folder created by shell script intallation nothing happens and I find this error on php_error.log:

PHP Fatal error:  Cannot redeclare phpunit_autoload() (previously declared in /usr/share/pear/PHPUnit/Autoload.php:51) in /Applications/MAMP/bin/php/php5.3.6/lib/php/PHPUnit/Autoload.php on line 205

This is some information about my current configuration state:

I'm using

MacOSX Lion 10.7, MAMP 2.0.3, PHP 5.3.6, PHPUnit 3.6.10

php -r 'foreach (explode(":", get_include_path()) as $path) echo $path . PHP_EOL;'
.
/Applications/MAMP/bin/php/php5.3.6/lib/php
/Applications/MAMP/bin/php/php5.3.6/lib/php/PEAR
/Applications/MAMP/bin/php/php5.3.6/lib/php/PHPUnit

php.ini is at /etc and is a softlink to MAMP php.ini

include_path = ".:/Applications/MAMP/bin/php/php5.3.6/lib/php:/Applications/MAMP/bin/php/php5.3.6/lib/php/PEAR:/Applications/MAMP/bin/php/php5.3.6/lib/php/PHPUnit"

more info:

$which php > /usr/bin/php
$which phpunit > /usr/bin/phpunit
$which pear > /usr/bin/pear

I installed CIUnit by shell script

1

1 Answers

0
votes

As I though I have PHPUnit duplicated.

I uninstall PHPUnit from /etc/bin using /etc/bin/PEAR and created a soft link to my MAMP PHPUnit at /etc/bin and Fixed! :-)