Test classes are not part of what a project ships, and a single autoload block cannot express that — so projects either map tests/ next to src/ and deploy it, or leave the suite to require its own files by hand. autoload-dev is the second block, and it is the one Composer drops when dev dependencies are skipped.
{
"autoload": {
"psr-0": { "App\": "src/" }
},
"autoload-dev": {
"classmap": [ "tests/" ],
"files": [ "tests/bootstrap.php" ]
}
}
A plain composer install merges both blocks into the generated autoloader; install --no-dev emits only the first, so the production classmap does not carry a few hundred test classes and dump-autoload --optimize has no reason to walk tests/. Confirming it is wired correctly is slightly unpleasant and worth doing once: run composer install --no-dev locally and the suite should fail to find its own bootstrap. A classmap rather than a namespace mapping is the practical choice for tests, because test class names rarely line up with their directories and renaming them to satisfy a standard is work with no return.