我的PHPUnit配置文件有两个测试套件,分别为unit
和system
。当我运行测试跑步者vendor/bin/phpunit
时,它将在两个套件中运行所有测试。我可以使用testsuite
标志:vendor/bin/phpunit --testsuite unit
来标记一个套件,但我需要配置测试运行器默认情况下仅运行unit
套件,并且只有在使用testsuite标志专门调用时才运行integration
。默认情况下在PHPUnit中运行单个测试套件
我的配置:
<?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'文件是不是更好,里面的配置? –