Last modified: 2012-12-08 22:37:50 UTC
Here's what happens when I try to run install-phpunit.sh and then phpunit.php: rkaldari$ sudo ./install-phpunit.sh Installing phpunit with pear Channel "pear.phpunit.de" is already initialized Channel "components.ez.no" is already initialized Channel "pear.symfony-project.com" is already initialized phpunit/PHPUnit is already installed and is the same as the released version 3.7.10 install failed rkaldari$ which phpunit rkaldari$ php phpunit.php PHPUnit 3.6.7 or later required, you have 3.5.15. I already have phpunit installed, but it's an old version, but for some reason install-phpunit.sh thinks I'm totally up to date. Perhaps I have more than one phpunit installed and it's checking the wrong one, or perhaps phpunit.php is checking the wrong one. Any help would be appreciated.
PHPUnit comes both with a `phpunit` CLI script and a set of lib files. The `phpunit` command is looked up according to your $PATH environment. On my install pear put it in /usr/local/bin : $ pear config-show |grep executables PEAR executables directory bin_dir /opt/local/bin My libraries are installed under /opt/local/share/pear : $ pear config-show |grep php_dir PEAR directory php_dir /opt/local/share/pear The libraries are looked up according to the include_path setting of your php.ini file. So include_path=".:/opt/local/share/pear". When you run "php phpunit.php", PHP lookup your include_path and seems to find a PHPUnit copy installed by your distribution, probably something like /usr/share/php/PEAR. To fix your problem you should: 1) include in your PATH the PEAR bin dir : pear config-show |grep executables 2) fix your include_path in /etc/php.ini so it points to PEAR php dir : pear config-show |grep php_dir Optionally: remove the phpunit package installed by your distribution :-)
Assuming this is going to work :-) Anyway that is not really a bug, more a support request.