我可能在这里很厚,但我不知道如何获得有关测试失败原因的一些信息。
例如,我有这个测试来检查我们是否没有任何没有测试的新方法......
//TEST ALL METHODS TESTED
public function testAllMethodsTested()
{
$temp = $this->class_namespace.substr(__CLASS__, 0, -5);
$class_methods = get_class_methods($temp);
$test_methods = get_class_methods(__CLASS__);
foreach($class_methods as $class_method)
{
$this->assertEquals(true, in_array('test_'.$class_method, $test_methods));
}
}
当这失败时,我会得到类似...
1) c_functions_core_ext_Test::testAllMethodsTested
Failed asserting that false matches expected true.
为了更容易看到去哪里修复一些代码,我想在控制台和 report.html 中获得一些有用的调试输出(就像你在验收测试中得到的那样)......
1) some_class_Test::testAllMethodsTested
Checking test exists for some_class::someMethod
Failed asserting that false matches expected true.
这可能用于单元测试吗?