在 PHPUnit 的帮助中显示如下:
--group ... Only runs tests from the specified group(s).
--exclude-group ... Exclude tests from the specified group(s).
对一组来说足够简单。这有效:
phpunit --group fast
现在,我不太明白如何对多个组执行此操作。以下对我不起作用:
phpunit --group fast unit # It believes you want to test unit.php
phpunit --group fast, unit # It believes you want to test unit.php
phpunit --group "fast unit" # It looks for a single group "fast unit"
phpunit --groups fast, unit # There is no option, groups
phpunit --group fast --group unit # Only one is honored
任何关于正确语法的想法都将受到欢迎。谢谢。
最佳答案
使用没有任何空格的逗号分隔。例如
phpunit --group fast,unit
关于php - 使用 PHPUnit,如何只测试两个或多个组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4806260/