Search code examples
cakephpphpunitcakephp-2.0pear

Installing PHPUnit with CakePHP on Windows/IIS


I followed the instructions given by CakePHP 2.x (via test.php) to install PHPUnit:

pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
pear install phpunit/PHPUnit-3.6.4

That all seemed to finish successfully, but test.php still says PHPUnit is not installed!

It also says to verify that PHPUnit is in the include_path in php.ini. I'm not exactly sure which path should be in the include_path. My current include_path is:

include_path=".;C:\Program Files (x86)\PHP\v5.3\PEAR\pear;C:\Program Files (x86)\PHP\v5.3\pear"

I don't see a PHPUnit folder or anything like that, though there is a PHPUnit-3.5.14.tar file in C:\Program Files (x86)\PHP\v5.3\PEAR\. I'm very new to PEAR, so it could easily be something fundamental going wrong.

I also tried restarting IIS after running the PEAR commands.


Solution

  • It was a combination of a couple factors.

    My PEAR version was out of date, so I installed the latest one. contrebis's comment was also a factor, the CakePHP docs were updated. Finally, I ran into this problem with installing PHPUnit. After all that, and an update of php.ini's include_path, I got it working.