如何在PHPUnit中找到进行风险测试的原因 [英] How to find the reason for a risky test in PHPUnit

查看:61
本文介绍了如何在PHPUnit中找到进行风险测试的原因的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有时会在PHPUnit中进行危险的测试.通常,我可以找到进行危险测试的原因.但是该任务可能很耗时,因为我看不到来自PHPUnit的任何消息,因此为什么测试被标记为有风险.我只会得到这样的东西:

From time to time I get a risky test in PHPUnit. Usually I can find the reason for a risky test. But the task can be time consuming, because I do not see any messages from PHPUnit, why a test is marked as risky. I only get something like this:

PHPUnit 4.4.5 by Sebastian Bergmann.

Configuration read from phpunit.xml.dist

R...................R.R...

Time: 11,91 seconds, Memory: 42,50Mb

OK, but incomplete, skipped, or risky tests!
Tests: 26, Assertions: 32, Risky: 3.        

是否有任何选项可以告诉PHPUnit显示消息或更好的代码,例如导致风险标志的代码的堆栈跟踪? 完整的风险测试原因清单也可能会有所帮助.

Is there any option to tell PHPUnit to show messages or better something like stack traces to the code causing the risky flag? A complete list of causes for a risky test might prove helpful, too.

推荐答案

这个问题值得一提,摘自上面的评论.

This question deserves an answer, taken from comments above.

phpunit -v

这简短描述了进行风险测试的原因

This gives a short description of the reason for the risky test

 -v|--verbose              Output more verbose information.

这篇关于如何在PHPUnit中找到进行风险测试的原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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