0

PHPUnit 是否具有反映目标对象的功能(或外部方式),并且在它没有测试的方法上失败或 markTestIncomplete()'ish?

To be clear; this would be in a situation where a test suite exists. A developer adds a new method, but neglects to write a test for it. Currently, it does not affect the unit testing process what-so-ever. I am looking for a way to change this.

Thanks in advance.

4

1 回答 1

1

PHPUnit 可以将代码覆盖率数据记录到带有序列化数据的文件中,您可以稍后对其进行分析。通过这种方式,您可以找到未经测试的方法:

 $ phpunit --coverage-php coveragedata.ser .

当类/方法未经测试或代码覆盖率低于阈值时,PHPUnit 3.7 本身无法失败。

于 2013-02-06T14:24:58.320 回答