我有一个最简单的套件,我一直在为我最近用 PHP 编写的一些 API 包装器代码编写代码。但是每次我运行测试时,它都会运行所有测试两次。
我的调用代码:
require_once(dirname(__FILE__) . '/simpletest/autorun.php');
require_once('CompanyNameAPI.php');
$test = new TestSuite('API test');
$test->addFile(dirname(__FILE__) . '/tests/authentication_test.php');
if (TextReporter::inCli()) {
exit ($test->run(new TextReporter()) ? 0 : 1);
} else {
$test->run(new HtmlReporter());
}
authentication_test.php 看起来像:
class Test_CallLoop_Authentication extends UnitTestCase {
function test_ClassCreate(){
$class = new CallLoopAPI();
$this->assertIsA($class, CallLoopAPI);
}
//More tests
}
在 authentication_test.php 中也不再包含 autorun.php 或其他对 simpletest 的调用。
想法?