如何告诉phpunit停止失败 [英] How to tell phpunit to stop on failure

查看:110
本文介绍了如何告诉phpunit停止失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行大量的phpunit测试,我想看看哪个测试在失败后立即失败,而不是等待所有测试完成然后列出所有失败.

I'm running a large suite of phpunit tests, and I'd like see which test failed as soon as it failed, rather than waiting for all of the tests to complete then having it list out all of the failures.

我如何告诉phpunit做到这一点?

How can I tell phpunit to do this?

推荐答案

stopOnFailure="true"属性添加到您的phpunit.xml根元素中.

Add the stopOnFailure="true" attribute to your phpunit.xml root element.

您也可以在CLI中使用它:phpunit --stop-on-failure

You can also use it in the CLI: phpunit --stop-on-failure

手册中的信息以及可能对您有用的其他信息:

Info from manual and some others that are maybe useful for you:

  • stopOnError-在出现第一个错误时停止执行."
  • stopOnFailure-在第一次错误或失败时停止执行."
  • stopOnIncomplete-在第一次未完成的测试后停止执行."

更多信息,请访问: PHPunit手册

这篇关于如何告诉phpunit停止失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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