如何在 PHPUnit 中过滤多个测试? [英] How to filter for multiple tests in PHPUnit?
本文介绍了如何在 PHPUnit 中过滤多个测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以使用 --filter
选项从套件中运行单个测试.
I am able to run a single test from a suite using --filter
option.
我想知道是否有办法在套件下动态运行多个测试?
I am wondering if there is a way to dynamically run multiple tests under the suite?
谢谢
推荐答案
一个用于过滤多个测试的简单正则表达式可能看起来像 --filter '/test1|test2|test4/'
.这将匹配包含test1"、test2"或test4"的任何测试,因此例如将包含 test43,但不会运行 test3.检查区分大小写.
A simple regex to filter for multiple tests could look like --filter '/test1|test2|test4/'
. This will match any tests which contain 'test1' 'test2' or 'test4' so for example test43 would be included, but test3 would not get run. The check is case-sensitive.
这篇关于如何在 PHPUnit 中过滤多个测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文