PHPUnit include path issues

software development

#1

I am having a little trouble getting PHPUnit to play nicely.

I followed the instructions on the wiki to install PEAR locally, this is working fine.

I have added the PEAR BIN_DIR to my $PATH in my .bash_profile so that I can run PHPUnit, I have also set my PHP_PEAR_PHP_BIN in my profile so that PEAR is running with PHP5.3. PHP5.3 is also the default php from my cli.

I have created the .php/5.3/phprc file as per the Wiki instructions, in this I have set the include path to include my local PEAR folder.

here is the output of some info commands…

maseru:~$ php -v
PHP 5.3.13 (cli) (built: Jun  7 2012 18:06:43)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
    with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
maseru:~$ php --ini
Configuration File (php.ini) Path: /etc/php53
Loaded Configuration File:         /etc/php53/php.ini
Scan for additional .ini files in: /etc/php53/conf.d
Additional .ini files parsed:      /home/[USERNAME]/.php/5.3/phprc
maseru:~$ php -i | grep include_path
include_path => .:/home/[USERNAME]/pear/php:/usr/local/lib/php:/usr/local/php5/lib/pear => .:/home/[USERNAME]/pear/php:/usr/local/lib/php:/usr/local/php5/lib/pear
maseru:~$ pear -V
PEAR Version: 1.9.4
PHP Version: 5.3.13
Zend Engine Version: 2.3.0
Running on: Linux maseru 2.6.32.8-grsec-2.1.14-modsign-xeon-64 #2 SMP Sat Mar 13 00:42:43 PST 2010 x86_64

however when I run PHPUnit I get an error and the include path doesn’t reflect my local PEAR

[code]
maseru:~$ phpunit

Warning: require_once(File/Iterator/Autoload.php): failed to open stream: No such file or directory in /home/[USERNAME]/pear/php/PHPUnit/Autoload.php on line 45

Fatal error: require_once(): Failed opening required ‘File/Iterator/Autoload.php’ (include_path=’.:/usr/local/lib/php:/usr/local/php5/lib/pear’) in /home/[USERNAME]/pear/php/PHPUnit/Autoload.php on line 45[/code]

What am I missing? This is driving me insane.

All help gratefully received.
[hr]
problem solved, it appears that I had installed PHPUnit before I had set the PHP_PEAR_PHP_BIN variable, meaning that the PHPUnit runner was using PHP5.2 and not 5.3