Если у вас несколько наборов тестов, настроенных в phpunit.xml
, как вы запускаете более одного набора тестов, но не все из них из командной строки?Как запустить несколько тестовых наборов PHPUnit из командной строки?
phpunit.xml
<?xml version="1.0" encoding="utf-8"?>
<phpunit
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="true"
syntaxCheck="true"
bootstrap="tests/bootstrap.php">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">tests/unit</directory>
</testsuite>
<testsuite name="Integration">
<directory suffix="Test.php">tests/integration</directory>
</testsuite>
<testsuite name="Acceptance">
<directory suffix="Test.php">tests/acceptance</directory>
</testsuite>
</testsuites>
<logging>
<log type="coverage-html" target="build/coverage"/>
<log type="testdox-html" target="build/requirements.html"/>
</logging>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
пример
phpunit --testsuite Unit|Integration
но не Acceptance
на самом деле проблема была решена (https://github.com/sebastianbergmann/phpunit/commit/80754cf323fe96003a2567f5e57404fddecff3bf). и теперь он работает, разделяя тесты с помощью запятой: 'phpunit --testsuite suite1, suite2' – emfi