PHPUnit - 通过命令行测试运行程序运行特定的测试套件
是否可以通过命令行测试运行程序从配置文件指定要运行哪个测试套件?例如,如果我有以下 xml 配置:
<phpunit ...>
<testsuites>
<testsuite name="My Test Suite 1">
<directory>./MyTestSuite1/</directory>
</testsuite>
<testsuite name="My Test Suite 2">
<directory>./MyTestSuite2/</directory>
</testsuite>
</testsuites>
...
</phpunit>
我可以让它仅运行“我的测试套件 1”吗?
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"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是
phpunit --testsuite“我的测试套件1”
It's
phpunit --testsuite "My Test Suite 1"
更新2013
匹配的测试正如下面@havg的回答提到的,现在可以使用 phpunit --testsuite 运行单独的测试套件
Update 2013
As @havg's answer below mentions, it's now possible to run individual test suites using
phpunit --testsuite
您是否尝试过从命令行运行 phpunit 时添加路径作为参数?
那么像
?
Have you tried when you run phpunit from the command line to add a path as a parameter?
So something like
?