i want start writing tests code installed latest phpunit 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 added /usr/local/bin php.ini include path looks this
include_path = ".:/applications/mamp/bin/php/php5.4.10/lib/php:/usr/local/bin"
but i'm getting following errors when visit /my-app/test.php
warning (2): include(phpunit/autoload.php): failed open stream: no such file or directory [core/cake/testsuite/caketestsuitedispatcher.php, line 150]
warning (2): include() [function.include]: failed opening 'phpunit/autoload.php' 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
/usr/local/bin/phpunit
didn't work. tried changing include path /usr/local/bin
/usr/local/bin/phpunit
, restarted apache (i'm using mamp pro on machine didn't work on ubuntu server)
a phpinfo()
shows include path being set correctly.
it's obvious i've missed. can tell me why isn't working?
cakephp recommends using pear install phpunit. should work better in case.
putting phar in /usr/local/bin filename 'phpunit' meant used running phpunit's testrunner via command line make phpunit command available. e.g. running command:
phpunit mytest test.php
when running in browser, need phpunit classes available load not work having path phar in include path. i'm not sure may work if include phar in test file:
require_once '/path/to/phpunit.phar'