Page MenuHomePhabricator

Allow extension registry/extension.json to autoload test helper classes only in test mode
Closed, DuplicatePublic

Description

When mocking classes in an extension it is necessary to have these mocks in the autoloader.

There is no way to define a class only for the test mode in extension.json

See https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/JsonConfig/+/555677/3/extension.json for a discussion about it.

Affected:

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

Event Timeline

Umherirrender renamed this task from Allow extension registry to autoload test helper classes only in test mode to Allow extension registry/extension.json to autoload test helper classes only in test mode.Dec 9 2019, 8:35 PM
Umherirrender updated the task description. (Show Details)