我使用的是PHPUNIT 3.4.5,我希望获得我的测试完成的断言总数(我的样例代码有3个断言)。方法"getNumAssertions“一直返回0。"\n";}phpunit --configuration phpunit_dev.xml --verbose
PHPUnit 3.4.5 by Sebastian Bergmann
类似的问题:
如何断言除了我可以定义的方法之外,没有任何方法被调用?下面的测试没有通过,因为PHPUnit验证了所有的期望()。//Here assert that only 'firstMethodToBeCalled' and 'secondMethodToBeCalled' are called, and no more
"Failed assert that false is true")。除了尝试/捕捉块中的所有测试并在显示异常消息之前从异常消息中剥离堆栈跟踪之外,还有其他方法吗?->evaluate(false, 'Type: R Expecte...')
#2 /usr/share/php/PHPUnit/Framework/Assert.php(888): PHPUnit_Framework_<em