使用PHPUnit,如何只测试两个或更多组?
在PHPUnit的帮助中,它显示以下内容:使用PHPUnit,如何只测试两个或更多组?,php,testing,Php,Testing,在PHPUnit的帮助中,它显示以下内容: --group ... Only runs tests from the specified group(s). --exclude-group ... Exclude tests from the specified group(s). 对一组人来说很容易。这项工作: phpunit --group fast 现在,我不太明白如何与多个团队合作。以下内容不适用于我: phpunit --group fa
--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”
或phpunit--group fast,unit
命令行参数是按空格分割的,因此您必须将值用双引号括起来或省略空格。使用逗号分隔,不带任何空格。例如
phpunit --group fast,unit
在使用phpunit并指定目录的情况下,
--exclude group
选项需要位于目录名之前。例如:
phpunit--排除组A、组B、组C您的\u目录
看起来--group“fast,unit”只使用fast组。谢谢你的回复;您的第二种方法非常有效。当组中有空格时,引号非常有用,例如当PHPdoc@author
标记由PHPunit转换为组时,您可以在引号中指定一个,而在引号中指定一些,例如PHPunit--group“你的名字很有魅力。谢谢这是——我相信Phpunit的作者也有意这样做,POSIX通常首先建议这样做。这是一个逗号,用于在参数中分隔值。备选方案a空格(别忘了引用参数),但在phpunit的情况下,不支持空格,只支持逗号。这适用于每个参数,而不仅仅是--排除组