PHP-简单测试-如何测试“包含"类 [英] PHP - Simpletest - How to test "included" classes

查看:129
本文介绍了PHP-简单测试-如何测试“包含"类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有遵循代码:

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]]

但是,如果我直接输入Config类代码(不包含"include"),则它可以工作. 我能做些什么? 谢谢=)

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

推荐答案

确保您拥有正确的测试用例路径.

Ensure you have the correct path to your test cases.

我还使用PHP autoLoader()函数自动神奇地解析了我自己的类路径,因此不需要将它们包含在路径中.

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.

这篇关于PHP-简单测试-如何测试“包含"类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆