使用PHPUnit的-过滤器选项进行多个测试 [英] Using PHPUnit's -- filter option for multiple tests
本文介绍了使用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屋!
查看全文