【问题标题】:Is there a comment to continue tests on failure in PHPUnit?是否有评论继续测试 PHPUnit 中的失败?
【发布时间】:2018-05-17 16:22:12
【问题描述】:

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

是否有一个 PHPUnit 命令的标志例如:

phpunit --continueonfailure

或在执行一系列测试期间的某事

【问题讨论】:

标签: testing phpunit


【解决方案1】:

我认为 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.

【讨论】:

    猜你喜欢
    • 2011-10-13
    • 1970-01-01
    • 1970-01-01
    • 2013-07-28
    • 2019-01-15
    • 1970-01-01
    • 2012-10-23
    • 2017-05-24
    • 1970-01-01
    相关资源
    最近更新 更多