E.g. in https://gerrit.wikimedia.org/r/436602 those two classes are only needed for tests, but are part of the main autoloader used in production. We already have a separate test autoloader, we should allow extensions to designate class maps or directories that should only be autoloaded during tests.
Affected extensions as of 2019-12-09:
AbuseFilter tests/phpunit/AbuseFilterConsequencesTest.php AbuseFilter tests/phpunit/unit/AbuseFilterParserTestCase.php ActiveAbstract tests/phpunit/DroppingReturnValueMap.php BetaFeatures tests/phpunit/BetaFeaturesTestCase.php BlueSpicePageTemplates tests/phpunit/utility/BSPageTemplateFixtures.php BlueSpiceReaders tests/phpunit/BSReadersFixtures.php CentralAuth tests/phpunit/CentralAuthTestUser.php CentralAuth tests/phpunit/CentralAuthUsingDatabaseTestCase.php CentralNotice tests/phpunit/CentralNoticeTestFixtures.php CentralNotice tests/phpunit/CNTestFixturesResourceLoaderModule.php CentralNotice tests/phpunit/TestingCNChoiceDataResourceLoaderModule.php CirrusSearch tests/phpunit/integration/CirrusIntegrationTestCase.php CirrusSearch tests/phpunit/unit/CirrusTestCase.php CirrusSearch tests/phpunit/unit/CirrusTestCaseTrait.php CirrusSearch tests/phpunit/unit/Fallbacks/BaseFallbackMethodTest.php CirrusSearch tests/phpunit/unit/Query/KeywordFeatureAssertions.php CirrusSearch tests/phpunit/unit/Query/SimpleKeywordFeatureTestTrait.php Cognate tests/phpunit/CheckSystemReqsTrait.php Echo tests/phpunit/mapper/EchoAbstractMapperStub.php Echo tests/phpunit/mapper/EchoExecuteFirstArgumentStub.php FlaggedRevs tests/phpunit/FlaggedRevsTestHooks.php Flow tests/phpunit/Api/ApiTestCase.php Flow tests/phpunit/FlowTestCase.php Flow tests/phpunit/Mock/ExternalStoreFlowMock.php Flow tests/phpunit/Mock/MockImportHeader.php Flow tests/phpunit/Mock/MockImportPost.php Flow tests/phpunit/Mock/MockImportRevision.php Flow tests/phpunit/Mock/MockImportSource.php Flow tests/phpunit/Mock/MockImportSummary.php Flow tests/phpunit/Mock/MockImportTopic.php Flow tests/phpunit/PostRevisionTestCase.php Genealogy tests/phpunit/GenealogyTestCase.php GlobalCssJs tests/phpunit/ResourceLoaderGlobalModuleTestTrait.php JsonConfig tests/phpunit/unit/ObjContent.php Lingo tests/phpunit/Util/XmlFileProvider.php MachineVision tests/helper/MockHelper.php MassMessage tests/phpunit/MassMessageApiTestCase.php MassMessage tests/phpunit/MassMessageTestCase.php Math tests/phpunit/DummyPropertyDataTypeLookup.php Math tests/phpunit/MathMLHttpRequestTester.php Math tests/phpunit/MathMLTestStatus.php MobileFrontend tests/phpunit/integration/api/MockApiMobileView.php MobileFrontend tests/phpunit/integration/api/MockWikiPage.php OAuthAuthentication tests/phpunit/OAuthAuthDBTest.php ORES tests/phpunit/includes/Hooks/HelpersTest.php ORES tests/phpunit/includes/MockOresServiceBuilder.php ORES tests/phpunit/includes/TestHelper.php PagedTiffHandler tests/phpunit-selenium/PagedTiffHandlerTestSuite.php PageTriage tests/phpunit/PageTriageTestCase.php PasswordlessLogin tests/phpunit/adapter/FakeChallengesRepository.php PasswordlessLogin tests/phpunit/adapter/FakeDevicesRepository.php PasswordlessLogin tests/phpunit/adapter/FakeFirebase.php PhpTags tests/phpunit/includes/PhpTagsTestClass.php ProofreadPage tests/phpunit/FileProviderMock.php ProofreadPage tests/phpunit/Index/IndexContentLookupMock.php ProofreadPage tests/phpunit/Page/IndexForPageLookupMock.php ProofreadPage tests/phpunit/Page/PageQualityLevelLookupMock.php ProofreadPage tests/phpunit/ProofreadPageTestCase.php Scribunto tests/phpunit/engines/LuaCommon/LuaDataProvider.php Scribunto tests/phpunit/engines/LuaCommon/LuaEngineTestBase.php Scribunto tests/phpunit/engines/LuaCommon/LuaEngineTestHelper.php Scribunto tests/phpunit/engines/LuaCommon/LuaEngineUnitTestBase.php TimedMediaHandler tests/phpunit/ApiVideoUploadTestCase.php TimedMediaHandler tests/phpunit/mocks/MockOggHandler.php Translate tests/phpunit/mocks/MockCacheMessageGroupLoader.php Translate tests/phpunit/mocks/MockFileBasedMessageGroup.php Translate tests/phpunit/mocks/MockMessageCollectionForExport.php Translate tests/phpunit/mocks/MockValidators.php Translate tests/phpunit/mocks/MockWikiMessageGroup.php TranslateSvg tests/phpunit/TranslateSvgTestCase.php WikimediaEvents tests/phpunit/PageViewsTest.php