testing - 在 PHPUnit 中是否有继续测试失败的命令?

标签 testing phpunit

有没有办法在命令行断言失败时继续执行 PHPUnit 测试?

是否有 PHPUnit 命令的标志示例,例如:

phpunit --continueonfailure

或在执行一系列测试期间发生的事情

最佳答案

我认为 PHPUnit 默认情况下会在失败时继续运行测试。因此,您可能已经在 phpunit.xml 中定义了 stopOnFailure="true"。要么完全删除它,要么尝试将其设置为 true

有几个标志可以附加到命令中,使 PHPUnit 在错误/失败时停止:

--stop-on-defect            Stop execution upon first not-passed test
--stop-on-error             Stop execution upon first error
--stop-on-failure           Stop execution upon first error or failure
--stop-on-warning           Stop execution upon first warning
--stop-on-risky             Stop execution upon first risky test
--stop-on-skipped           Stop execution upon first skipped test
--stop-on-incomplete        Stop execution upon first incomplete test

您可以 read more about phpunit.xml here.

关于testing - 在 PHPUnit 中是否有继续测试失败的命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50396253/

相关文章:

testing - 结构化 UAT 方法

php - 如何在 PHP 中为单元测试伪造资源?

testing - Angular 2 测试 nativeElement

node.js - 未找到 Mocha 测试 : "0 passing"

php - 用于与 phpunit 集成测试的数据库恢复

PHPUnit 和 Composer : [InvalidArgumentException] Command "path/to/test" is not defined

php - 如何使用 PHPUnit 测试 Web 服务?

unit-testing - 使用 PHPUnit 3.5 测试时出错

ruby - 如何使用 ruby​​ 和 MiniTest 伪造 Web 服务

testing - 模拟 Grails Spring Security 登录用户