PHPUnit "--testsuite" Not Found - Wrong Suite Name in CI
A --testsuite <name> flag selects one of the <testsuite> definitions in phpunit.xml. When the name is misspelled, renamed, or missing from the config, PHPUnit cannot find that suite and runs nothing.
What this error means
A CI command like phpunit --testsuite integration fails with "Test suite … could not be found" (or runs zero tests). The suite name in the workflow does not match a <testsuite name="…"> in phpunit.xml.
$ vendor/bin/phpunit --testsuite integration
There is no test suite with the name "integration" defined in the configuration.
Available suites: unit, featureCommon causes
The suite name does not match the config
A typo, a renamed suite, or a different phpunit.xml than CI loads means the requested --testsuite name has no matching <testsuite>.
A different configuration file is in effect
CI may pick up phpunit.xml.dist or a different file than you expect, whose suite names differ.
How to fix it
List the defined suites
See exactly which suite names the active config defines.
vendor/bin/phpunit --list-suites
vendor/bin/phpunit --configuration phpunit.xml --list-suitesMatch the name and define the suite
Use a name that exists, or add the suite to phpunit.xml.
<!-- phpunit.xml -->
<testsuites>
<testsuite name="unit"><directory>tests/Unit</directory></testsuite>
<testsuite name="integration"><directory>tests/Integration</directory></testsuite>
</testsuites>Pin the configuration explicitly
Make CI and local load the same config so suite names agree.
vendor/bin/phpunit --configuration phpunit.xml --testsuite integrationHow to prevent it
- Keep
--testsuitenames in CI in sync withphpunit.xml. - Pin
--configurationso the same suites resolve everywhere. - Run
--list-suitesto verify available names before relying on one.