我的PHPUnit配置文件有两个测试套件:unit
和system
。当我运行测试运行器vendor/bin/phpunit
时,它会在两个套件中运行所有测试。我可以使用testsuite
标记指定一个单独的测试套件:vendor/bin/phpunit --testsuite unit
,但我需要配置测试运行器默认只运行unit
套件,并且仅在使用testsuite
标记时才运行integration
。
我的配置:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true">
<testsuites>
<testsuite name="unit">
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="integration">
<directory>tests/Integration</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="build/clover.xml"/>
</logging>
</phpunit>
phpunit_unit.sh
和phpunit_integration.sh
两个文件,并将相关配置写在其中,这样不会更好吗? - Felippe Duarte