php - 如何告诉 phpunit 在失败时停止

标签 php unit-testing phpunit

我正在运行大量的 phpunit 测试,我想看看哪个测试一旦失败就失败了,而不是等待所有测试完成然后让它列出所有失败。

我怎样才能告诉 phpunit 这样做?

最佳答案

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

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

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

  • stopOnError - “出现第一个错误时停止执行。”
  • stopOnFailure - “在第一个错误或失败时停止执行。”
  • stopOnIncomplete - “在第一次不完整的测试时停止执行。”

更多信息请访问:PHPunit manual

关于php - 如何告诉 phpunit 在失败时停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30037315/

相关文章:

mysql - 为 PHPUnit 模拟 MySQL DB

带有数组和 $this->anything() 的 PHPUnit "with"匹配器

PHP - 检查是否设置了任何 GET 数据

php - 单独的类方法声明和定义?

java - 是否不需要验证与 Mockito 中模拟的方法相同的方法?

node.js - proxyquire类型错误: Datastore is not a constructor

css - Selenium RC : Selecting elements using the CSS :contains pseudo-class

php - 如何检测 PHP 和 PCRE 中的 Unicode 版本?

PHP:在html页面上显示表格内容

android - 如何访问 android 测试项目中的原始资源?