PHP - Simpletest - How to test “included” classes

与世无争的帅哥 提交于 2019-12-11 12:50:36

问题


I have de follow code:

include 'simpletest/autorun.php';
include 'config_test.case.php'; // <-- problem

But it not works. I get:

Bad TestSuite [index.php] with error [No runnable test cases in [index.php]]

But if I put the Config class code directly (no "include"), it works. What can I do? Thx =)


回答1:


Ensure you have the correct path to your test cases.

I also use the PHP autoLoader() function to auto-magically resolve my own class paths so they don't need to be inclcuded in the paths.



来源:https://stackoverflow.com/questions/4282061/php-simpletest-how-to-test-included-classes

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