有没有办法在命令行断言失败时继续执行 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
关于testing - 在 PHPUnit 中是否有继续测试失败的命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50396253/