Skip to content
Latchkey

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.

PHPUnit output
$ vendor/bin/phpunit --testsuite integration
There is no test suite with the name "integration" defined in the configuration.

Available suites: unit, feature

Common 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.

Terminal
vendor/bin/phpunit --list-suites
vendor/bin/phpunit --configuration phpunit.xml --list-suites

Match the name and define the suite

Use a name that exists, or add the suite to phpunit.xml.

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.

Terminal
vendor/bin/phpunit --configuration phpunit.xml --testsuite integration

How to prevent it

  • Keep --testsuite names in CI in sync with phpunit.xml.
  • Pin --configuration so the same suites resolve everywhere.
  • Run --list-suites to verify available names before relying on one.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →