PHP Fatal error: Class 'CTestCase' not found in

ⅰ亾dé卋堺 提交于 2019-12-13 13:14:56

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!