我见过How to run single test method with phpunit?
而且我可以轻松应用过滤器,例如 --filter=SomeTest
但我希望能够在一个命令行中检查许多测试文件,例如,--filter=SomeTest, SomeOtherTest
但这不起作用。
有没有办法从命令行执行此操作?
最佳答案
这个作品--filter="SomeTest|SomeOtherTest"
根据此处找到的文档:
https://phpunit.readthedocs.io/en/8.5/textui.html#command-line-options
任何正则表达式模式也将起作用。
“如果模式未包含在分隔符中,PHPUnit 会将模式包含在/分隔符中。”
还帮助我阅读了正则表达式:
https://sitespect.force.com/onlinehelp/s/article/About-Regular-Expressions-1459718276
关于PhpUnit 如何在多个条件下运行 --filter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60257654/