[英]How can i run phpunit tests from excluded list?
我在phpunit.xml
有此配置。 我担心的是,我不想在执行phpuint
命令时运行测试。
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
<exclude>./tests/Feature</exclude>
</testsuite>
我需要分别运行功能测试,这可能吗?
我做同样的事情来限制正在运行的测试-较大的设置仅在我专门运行所有测试时才运行,而对于正常的快速运行而言,只有不到一半的运行。
技巧是将@group
批注添加到测试源(基于类或方法)-因此,例如:
/**
* @group feature
* @group large
*/
public function testFeatureThatTakesTime() {}
现在,如果您运行vendor/bin/phpunit --exclude-group feature ./tests/
,它将不会运行该测试。 我在外壳程序脚本中有该脚本和其他一些命令行参数,还有其他方法可以运行所有测试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.