开发者

Using PHPUnit, How Do You Test Only Two or More Groups?

In PHPUnit's help it displays the following:

  --group ...              Only runs tests from the specified group(s).
  --exclude-group ...      Exclude tests from the specified group(s).

Easy enough for one group. This works:

phpunit --group fast

Now, I can't quite figure out how to do this with more than one group. The following is not working for me:

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 i开发者_JAVA技巧s honored

Any thoughts on the correct syntax would be welcome. Thank you.


Use comma separation without any whitespace. E.g.

phpunit --group fast,unit


Try phpunit --group "fast, unit" or phpunit --group fast,unit.

Command-line parameters are split on space, so you have to either wrap the value in double quotes or omit spaces.


In case you use phpunit and specify a directory, the --exclude-group option needs to come before the directory name. E.g.:

phpunit --exclude-group GroupA,GroupB,GroupC YOUR_DIRECTORY

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜