问题
Just trying to run a simple test on my local box but i get the following error:
PHP Fatal error: Class 'CTestCase' not found in ....
when running
$ phpunit UserTest
I guess my configuration must be missing something? I just can't figure out what.
Using:
OSX 10.6.7
PHP 5.3.4
PHPUnit 3.5.13
Yii 1.1.7
回答1:
Make sure you run phpunit at the same directory where your phpunit.xml is. :)
回答2:
The error message is telling you that the class CTestCase
cannot be located. PHPUnit accepts an --include-path
option on the command line. You could try something like this:
$ phpunit --include-path .:/path/to/dir/containing/CTestCase UserTest
回答3:
I found the solution for me. But i am not sure whether this works for you all or not.
Here is the url for the solution
http://www.yiiframework.com/forum/index.php/topic/4728-running-unit-tests-on-windows-problem/
来源:https://stackoverflow.com/questions/6241194/php-fatal-error-class-ctestcase-not-found-in