开发者

PHPUnit - Running a particular test suite via the command line test runner [duplicate]

This question already has answers here: How to run a specific phpunit xml testsuite? (5 answers) Closed 7 years ago.

Is it possible to specify which test suite to run from a configuration file via the command line test runner? For example, if I have the following xml configuration:

<phpunit ...>
    <testsuites>
        <testsuite name="My Test Suite 1">
            <directory>./MyTestSuite1/</directory>
        </testsuite>
        <testsuite name="My Test Suite 2">
            <directory>./MyTestSuite2/</directory>
        </testsuite>
    </testsuites>
    ...
</phpunit>

Can I have it run only "My Test Suite 1开发者_Go百科"?


It's phpunit --testsuite "My Test Suite 1"


  • you can use the @group tag in the class documentation to indicate the group and then run tests only on that group using --group
  • you can use --filter to only run tests that match a given regex

Update 2013

As @havg's answer below mentions, it's now possible to run individual test suites using phpunit --testsuite


Have you tried when you run phpunit from the command line to add a path as a parameter?

So something like

 phpUnit ./MyTestSuite1/

?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜