I want to start writing tests for my code so I installed the latest PHPUnit with the following commands
wget http://pear.phpunit.de/get/phpunit.phar
chmod +x phpunit.phar
mv phpunit.phar /usr/local/bin/phpunit
http://phpunit.de/manual/3.8/en/installation.html
then I added /usr/local/bin to my php.ini include path which looks like this
include_path = ".:/Applications/MAMP/bin/php/php5.4.10/lib/php:/usr/local/bin"
but I'm getting the following errors when I visit /my-app/test.php
Warning (2): include(PHPUnit/Autoload.php): failed to open stream: No such file or directory [CORE/Cake/TestSuite/CakeTestSuiteDispatcher.php, line 150]
Warning (2): include() [function.include]: Failed opening 'PHPUnit/Autoload.php' for inclusion (include_path='/Users/DevinCrossman/Sites/studio-bliss/lib:.:/Applications/MAMP/bin/php/php5.4.10/lib/php:/usr/local/bin') [CORE/Cake/TestSuite/CakeTestSuiteDispatcher.php, line 150]
I tried changing /usr/local/bin/phpunit
to /usr/local/bin/PHPUnit
but that didn't work. I also tried changing the include path from /usr/local/bin
to /usr/local/bin/phpunit
and restarted apache (I'm using MAMP PRO on this machine but it also didn't work on my ubuntu server)
a phpinfo()
shows the include path is being set correctly.
it's probably something obvious that I've missed. Can anyone tell me why this isn't working?