Remove unneeded overrideMwServices/resetServices
authorAryeh Gregor <ayg@aryeh.name>
Mon, 26 Aug 2019 09:13:49 +0000 (12:13 +0300)
committerAryeh Gregor <ayg@aryeh.name>
Thu, 29 Aug 2019 11:26:18 +0000 (14:26 +0300)
Change-Id: If6cbdec05b8f310ef3a0b4649aaa16d9fb80a047

39 files changed:
tests/phpunit/includes/ActorMigrationTest.php
tests/phpunit/includes/ContentSecurityPolicyTest.php
tests/phpunit/includes/GlobalFunctions/GlobalTest.php
tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php
tests/phpunit/includes/MessageTest.php
tests/phpunit/includes/MovePageTest.php
tests/phpunit/includes/Permissions/PermissionManagerTest.php
tests/phpunit/includes/PrefixSearchTest.php
tests/phpunit/includes/Rest/BasicAccess/MWBasicRequestAuthorizerTest.php
tests/phpunit/includes/Revision/RevisionQueryInfoTest.php
tests/phpunit/includes/Revision/RevisionStoreDbTestBase.php
tests/phpunit/includes/RevisionDbTestBase.php
tests/phpunit/includes/RevisionTest.php
tests/phpunit/includes/TitlePermissionTest.php
tests/phpunit/includes/TitleTest.php
tests/phpunit/includes/api/ApiBlockTest.php
tests/phpunit/includes/api/ApiDeleteTest.php
tests/phpunit/includes/api/ApiEditPageTest.php
tests/phpunit/includes/api/ApiMainTest.php
tests/phpunit/includes/api/ApiMoveTest.php
tests/phpunit/includes/api/ApiParseTest.php
tests/phpunit/includes/api/ApiUserrightsTest.php
tests/phpunit/includes/api/query/ApiQueryUserContribsTest.php
tests/phpunit/includes/auth/AuthManagerTest.php
tests/phpunit/includes/block/BlockManagerTest.php
tests/phpunit/includes/cache/MessageCacheTest.php
tests/phpunit/includes/filerepo/RepoGroupTest.php
tests/phpunit/includes/interwiki/InterwikiTest.php
tests/phpunit/includes/objectcache/ObjectCacheTest.php
tests/phpunit/includes/page/PageArchiveTestBase.php
tests/phpunit/includes/page/WikiPageDbTestBase.php
tests/phpunit/includes/resourceloader/ResourceLoaderTest.php
tests/phpunit/includes/search/SearchEnginePrefixTest.php
tests/phpunit/includes/specialpage/ChangesListSpecialPageTest.php
tests/phpunit/includes/specialpage/SpecialPageFactoryTest.php
tests/phpunit/includes/title/NamespaceInfoTest.php
tests/phpunit/includes/user/UserGroupMembershipTest.php
tests/phpunit/includes/user/UserTest.php
tests/phpunit/tests/MediaWikiTestCaseTest.php

index 40c45dc..46c0c42 100644 (file)
@@ -658,7 +658,6 @@ class ActorMigrationTest extends MediaWikiLangTestCase {
                        // for User::getActorId()
                        'wgActorTableSchemaMigrationStage' => $stage
                ] );
-               $this->overrideMwServices();
 
                $user = $this->getMutableTestUser()->getUser();
                $userIdentity = $this->getMock( UserIdentity::class );
index 5d6c067..beddfe8 100644 (file)
@@ -41,7 +41,6 @@ class ContentSecurityPolicyTest extends MediaWikiTestCase {
                // Note, there are some obscure globals which
                // could affect the results which aren't included above.
 
-               $this->overrideMwServices();
                $context = RequestContext::getMain();
                $resp = $context->getRequest()->response();
                $conf = $context->getConfig();
index 8f8f54a..6b650cd 100644 (file)
@@ -120,9 +120,6 @@ class GlobalTest extends MediaWikiTestCase {
                fwrite( $f, 'Message' );
                fclose( $f );
 
-               // Reset the service to avoid cached results
-               $this->overrideMwServices();
-
                $this->assertTrue( wfReadOnly() );
                $this->assertTrue( wfReadOnly() ); # Check cached
        }
@@ -137,7 +134,6 @@ class GlobalTest extends MediaWikiTestCase {
                $this->setMwGlobals( [
                        'wgReadOnly' => 'reason'
                ] );
-               $this->overrideMwServices();
 
                $this->assertSame( 'reason', wfReadOnlyReason() );
        }
index 95571f2..d8d5495 100644 (file)
@@ -18,9 +18,6 @@ class GlobalWithDBTest extends MediaWikiTestCase {
 
                // Don't try to fetch the files from Commons or anything, please
                $this->setMwGlobals( 'wgForeignFileRepos', [] );
-               // We need to reset services immediately so that editPage() doesn't use the old RepoGroup
-               // and hit the network
-               $this->resetServices();
 
                // XXX How do we get file redirects to work?
                $this->editPage( 'File:Redirect to bad.jpg', '#REDIRECT [[Bad.jpg]]' );
index fb32ef7..37d4e0c 100644 (file)
@@ -404,9 +404,6 @@ class MessageTest extends MediaWikiLangTestCase {
         */
        public function testRawHtmlInMsg() {
                $this->setMwGlobals( 'wgRawHtml', true );
-               // We have to reset the core hook registration.
-               // to register the html hook
-               $this->overrideMwServices();
 
                $msg = new RawMessage( '<html><script>alert("xss")</script></html>' );
                $txt = '<span class="error">&lt;html&gt; tags cannot be' .
index 2895fa2..8596035 100644 (file)
@@ -197,7 +197,6 @@ class MovePageTest extends MediaWikiTestCase {
                foreach ( $extraOptions as $key => $val ) {
                        $this->setMwGlobals( "wg$key", $val );
                }
-               $this->overrideMwServices();
                $this->setService( 'RepoGroup', $this->getMockRepoGroup() );
                // This returns true instead of an array if there are no errors
                $this->hideDeprecated( 'Title::isValidMoveOperation' );
index 44b7f67..8398ea4 100644 (file)
@@ -122,8 +122,6 @@ class PermissionManagerTest extends MediaWikiLangTestCase {
 
                        $this->user = $this->userUser;
                }
-
-               $this->resetServices();
        }
 
        public function tearDown() {
@@ -143,7 +141,6 @@ class PermissionManagerTest extends MediaWikiLangTestCase {
                } else {
                        $this->user = $this->altUser;
                }
-               $this->resetServices();
        }
 
        /**
@@ -421,8 +418,7 @@ class PermissionManagerTest extends MediaWikiLangTestCase {
 
                        global $wgGroupPermissions;
                        $old = $wgGroupPermissions;
-                       $wgGroupPermissions = [];
-                       $this->resetServices();
+                       $this->setMwGlobals( 'wgGroupPermissions', [] );
 
                        $this->assertEquals( $check[$action][1],
                                MediaWikiServices::getInstance()->getPermissionManager()
@@ -433,8 +429,7 @@ class PermissionManagerTest extends MediaWikiLangTestCase {
                        $this->assertEquals( $check[$action][1],
                                MediaWikiServices::getInstance()->getPermissionManager()
                                        ->getPermissionErrors( $action, $this->user, $this->title, 'secure' ) );
-                       $wgGroupPermissions = $old;
-                       $this->resetServices();
+                       $this->setMwGlobals( 'wgGroupPermissions', $old );
 
                        $this->overrideUserPermissions( $this->user, $action );
                        $this->assertEquals( $check[$action][2],
@@ -460,39 +455,33 @@ class PermissionManagerTest extends MediaWikiLangTestCase {
        }
 
        protected function runGroupPermissions( $perm, $action, $result, $result2 = null ) {
-               global $wgGroupPermissions;
-
                if ( $result2 === null ) {
                        $result2 = $result;
                }
 
-               $wgGroupPermissions['autoconfirmed']['move'] = false;
-               $wgGroupPermissions['user']['move'] = false;
-               $this->resetServices();
+               $this->setGroupPermissions( 'autoconfirmed', 'move', false );
+               $this->setGroupPermissions( 'user', 'move', false );
                $this->overrideUserPermissions( $this->user, $perm );
                $res = MediaWikiServices::getInstance()->getPermissionManager()
                        ->getPermissionErrors( $action, $this->user, $this->title );
                $this->assertEquals( $result, $res );
 
-               $wgGroupPermissions['autoconfirmed']['move'] = true;
-               $wgGroupPermissions['user']['move'] = false;
-               $this->resetServices();
+               $this->setGroupPermissions( 'autoconfirmed', 'move', true );
+               $this->setGroupPermissions( 'user', 'move', false );
                $this->overrideUserPermissions( $this->user, $perm );
                $res = MediaWikiServices::getInstance()->getPermissionManager()
                        ->getPermissionErrors( $action, $this->user, $this->title );
                $this->assertEquals( $result2, $res );
 
-               $wgGroupPermissions['autoconfirmed']['move'] = true;
-               $wgGroupPermissions['user']['move'] = true;
-               $this->resetServices();
+               $this->setGroupPermissions( 'autoconfirmed', 'move', true );
+               $this->setGroupPermissions( 'user', 'move', true );
                $this->overrideUserPermissions( $this->user, $perm );
                $res = MediaWikiServices::getInstance()->getPermissionManager()
                        ->getPermissionErrors( $action, $this->user, $this->title );
                $this->assertEquals( $result2, $res );
 
-               $wgGroupPermissions['autoconfirmed']['move'] = false;
-               $wgGroupPermissions['user']['move'] = true;
-               $this->resetServices();
+               $this->setGroupPermissions( 'autoconfirmed', 'move', false );
+               $this->setGroupPermissions( 'user', 'move', true );
                $this->overrideUserPermissions( $this->user, $perm );
                $res = MediaWikiServices::getInstance()->getPermissionManager()
                        ->getPermissionErrors( $action, $this->user, $this->title );
@@ -1144,7 +1133,6 @@ class PermissionManagerTest extends MediaWikiLangTestCase {
                                ->getPermissionErrors( 'edit', $this->user, $this->title ) );
 
                $this->setMwGlobals( 'wgEmailConfirmToEdit', false );
-               $this->resetServices();
                $this->overrideUserPermissions( $this->user, [
                        'createpage',
                        'edit',
@@ -1577,7 +1565,6 @@ class PermissionManagerTest extends MediaWikiLangTestCase {
                        $rights = array_diff( $rights, [ 'writetest' ] );
                } );
 
-               $this->resetServices();
                $rights = MediaWikiServices::getInstance()
                        ->getPermissionManager()
                        ->getUserPermissions( $user );
@@ -1859,7 +1846,6 @@ class PermissionManagerTest extends MediaWikiLangTestCase {
                        'wgRestrictionLevels' => [ '', 'autoconfirmed', 'sysop' ],
                        'wgAutopromote' => []
                ] );
-               $this->resetServices();
                $user = is_null( $userGroups ) ? null : $this->getTestUser( $userGroups )->getUser();
                $this->assertSame( $expected, MediaWikiServices::getInstance()
                        ->getPermissionManager()
index 685cb40..4d9f8e1 100644 (file)
@@ -60,8 +60,6 @@ class PrefixSearchTest extends MediaWikiLangTestCase {
 
                $this->originalHandlers = TestingAccessWrapper::newFromClass( Hooks::class )->handlers;
                TestingAccessWrapper::newFromClass( Hooks::class )->handlers = [];
-
-               $this->overrideMwServices();
        }
 
        public function tearDown() {
index 49dcf07..3c6573a 100644 (file)
@@ -25,7 +25,6 @@ class MWBasicRequestAuthorizerTest extends MediaWikiTestCase {
                $user = User::newFromName( 'Test user' );
                // Don't allow the rights to everybody so that user rights kick in.
                $this->mergeMwGlobalArrayValue( 'wgGroupPermissions', [ '*' => $userRights ] );
-               $this->resetServices();
                $this->overrideUserPermissions(
                        $user,
                        array_keys( array_filter( $userRights ), function ( $value ) {
index 57619c5..5cc3646 100644 (file)
@@ -960,7 +960,6 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
         */
        public function testRevisionSelectFields( $migrationStageSettings, $expected ) {
                $this->setMwGlobals( $migrationStageSettings );
-               $this->overrideMwServices();
 
                $this->hideDeprecated( 'Revision::selectFields' );
                $this->assertArrayEqualsIgnoringIntKeyOrder( $expected, Revision::selectFields() );
@@ -972,7 +971,6 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
         */
        public function testRevisionSelectArchiveFields( $migrationStageSettings, $expected ) {
                $this->setMwGlobals( $migrationStageSettings );
-               $this->overrideMwServices();
 
                $this->hideDeprecated( 'Revision::selectArchiveFields' );
                $this->assertArrayEqualsIgnoringIntKeyOrder( $expected, Revision::selectArchiveFields() );
@@ -984,7 +982,6 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
        public function testRevisionUserJoinCond() {
                $this->hideDeprecated( 'Revision::userJoinCond' );
                $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_OLD );
-               $this->overrideMwServices();
                $this->assertEquals(
                        [ 'LEFT JOIN', [ 'rev_user != 0', 'user_id = rev_user' ] ],
                        Revision::userJoinCond()
@@ -1041,7 +1038,6 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
         */
        public function testRevisionGetArchiveQueryInfo( $migrationStageSettings, $expected ) {
                $this->setMwGlobals( $migrationStageSettings );
-               $this->overrideMwServices();
 
                $queryInfo = Revision::getArchiveQueryInfo();
                $this->assertQueryInfoEquals( $expected, $queryInfo );
@@ -1053,7 +1049,6 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
         */
        public function testRevisionGetQueryInfo( $migrationStageSettings, $options, $expected ) {
                $this->setMwGlobals( $migrationStageSettings );
-               $this->overrideMwServices();
 
                $queryInfo = Revision::getQueryInfo( $options );
                $this->assertQueryInfoEquals( $expected, $queryInfo );
@@ -1065,7 +1060,6 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
         */
        public function testRevisionStoreGetQueryInfo( $migrationStageSettings, $options, $expected ) {
                $this->setMwGlobals( $migrationStageSettings );
-               $this->overrideMwServices();
 
                $store = MediaWikiServices::getInstance()->getRevisionStore();
 
@@ -1083,7 +1077,6 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                $expected
        ) {
                $this->setMwGlobals( $migrationStageSettings );
-               $this->overrideMwServices();
 
                $store = MediaWikiServices::getInstance()->getRevisionStore();
 
@@ -1097,7 +1090,6 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
         */
        public function testRevisionStoreGetArchiveQueryInfo( $migrationStageSettings, $expected ) {
                $this->setMwGlobals( $migrationStageSettings );
-               $this->overrideMwServices();
 
                $store = MediaWikiServices::getInstance()->getRevisionStore();
 
index d4393dd..55bfab7 100644 (file)
@@ -83,8 +83,6 @@ abstract class RevisionStoreDbTestBase extends MediaWikiTestCase {
                        'wgContentHandlerUseDB' => $this->getContentHandlerUseDB(),
                        'wgActorTableSchemaMigrationStage' => SCHEMA_COMPAT_NEW,
                ] );
-
-               $this->overrideMwServices();
        }
 
        protected function addCoreDBData() {
@@ -403,7 +401,6 @@ abstract class RevisionStoreDbTestBase extends MediaWikiTestCase {
                $title = $this->getTestPageTitle();
                $rev = $this->getRevisionRecordFromDetailsArray( $revDetails );
 
-               $this->overrideMwServices();
                $store = MediaWikiServices::getInstance()->getRevisionStore();
                $return = $store->insertRevisionOn( $rev, wfGetDB( DB_MASTER ) );
 
@@ -480,7 +477,6 @@ abstract class RevisionStoreDbTestBase extends MediaWikiTestCase {
                        'user' => true,
                ];
 
-               $this->overrideMwServices();
                $store = MediaWikiServices::getInstance()->getRevisionStore();
 
                // Insert the first revision
@@ -594,8 +590,6 @@ abstract class RevisionStoreDbTestBase extends MediaWikiTestCase {
         * @covers \MediaWiki\Revision\RevisionStore::findSlotContentId
         */
        public function testNewNullRevision( Title $title, $revDetails, $comment, $minor = false ) {
-               $this->overrideMwServices();
-
                $user = TestUserRegistry::getMutableTestUser( __METHOD__ )->getUser();
                $page = WikiPage::factory( $title );
 
@@ -1021,7 +1015,6 @@ abstract class RevisionStoreDbTestBase extends MediaWikiTestCase {
         */
        public function testNewRevisionFromRow_anonEdit_legacyEncoding() {
                $this->setMwGlobals( 'wgLegacyEncoding', 'windows-1252' );
-               $this->overrideMwServices();
                $page = $this->getTestPage();
                $text = __METHOD__ . 'a-ä';
                /** @var Revision $rev */
@@ -1101,7 +1094,6 @@ abstract class RevisionStoreDbTestBase extends MediaWikiTestCase {
         */
        public function testNewRevisionFromArchiveRow_legacyEncoding() {
                $this->setMwGlobals( 'wgLegacyEncoding', 'windows-1252' );
-               $this->overrideMwServices();
                $store = MediaWikiServices::getInstance()->getRevisionStore();
                $title = Title::newFromText( __METHOD__ );
                $text = __METHOD__ . '-bä';
@@ -1797,7 +1789,6 @@ abstract class RevisionStoreDbTestBase extends MediaWikiTestCase {
        public function testGetKnownCurrentRevision_userNameChange() {
                global $wgActorTableSchemaMigrationStage;
 
-               $this->overrideMwServices();
                $cache = new WANObjectCache( [ 'cache' => new HashBagOStuff() ] );
                $this->setService( 'MainWANObjectCache', $cache );
 
@@ -1838,7 +1829,6 @@ abstract class RevisionStoreDbTestBase extends MediaWikiTestCase {
         * @covers \MediaWiki\Revision\RevisionStore::getKnownCurrentRevision
         */
        public function testGetKnownCurrentRevision_revDelete() {
-               $this->overrideMwServices();
                $cache = new WANObjectCache( [ 'cache' => new HashBagOStuff() ] );
                $this->setService( 'MainWANObjectCache', $cache );
 
index 83e8d85..7b334ee 100644 (file)
@@ -95,8 +95,6 @@ abstract class RevisionDbTestBase extends MediaWikiTestCase {
                        'wgActorTableSchemaMigrationStage' => SCHEMA_COMPAT_NEW,
                ] );
 
-               $this->overrideMwServices();
-
                if ( !$this->testPage ) {
                        /**
                         * We have to create a new page for each subclass as the page creation may result
index d62e4c7..865bd31 100644 (file)
@@ -281,7 +281,6 @@ class RevisionTest extends MediaWikiTestCase {
         * @covers \MediaWiki\Revision\RevisionStore::newMutableRevisionFromArray
         */
        public function testConstructFromRowWithBadPageId() {
-               $this->overrideMwServices();
                Wikimedia\suppressWarnings();
                $rev = new Revision( (object)[
                        'rev_page' => 77777777,
@@ -603,7 +602,6 @@ class RevisionTest extends MediaWikiTestCase {
         */
        public function testLoadFromTitle() {
                $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW );
-               $this->overrideMwServices();
                $title = $this->getMockTitle();
 
                $conditions = [
index 91c4a13..6c17bf5 100644 (file)
@@ -72,7 +72,6 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
 
                        $this->user = $this->userUser;
                }
-               $this->resetServices();
        }
 
        protected function setTitle( $ns, $title = "Main_Page" ) {
@@ -329,9 +328,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
 
                        global $wgGroupPermissions;
                        $old = $wgGroupPermissions;
-                       $wgGroupPermissions = [];
-
-                       $this->resetServices();
+                       $this->setMwGlobals( 'wgGroupPermissions', [] );
 
                        $this->assertEquals( $check[$action][1],
                                $this->title->getUserPermissionsErrors( $action, $this->user, true ) );
@@ -340,8 +337,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                        $this->assertEquals( $check[$action][1],
                                $this->title->getUserPermissionsErrors( $action, $this->user, 'secure' ) );
 
-                       $wgGroupPermissions = $old;
-                       $this->resetServices();
+                       $this->setMwGlobals( 'wgGroupPermissions', $old );
 
                        $this->overrideUserPermissions( $this->user, $action );
                        $this->assertEquals( $check[$action][2],
@@ -361,8 +357,6 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
        }
 
        protected function runGroupPermissions( $action, $result, $result2 = null ) {
-               global $wgGroupPermissions;
-
                if ( $result2 === null ) {
                        $result2 = $result;
                }
@@ -375,30 +369,26 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                $userPermsOverrides = MediaWikiServices::getInstance()->getPermissionManager()
                        ->getUserPermissions( $this->user );
 
-               $wgGroupPermissions['autoconfirmed']['move'] = false;
-               $wgGroupPermissions['user']['move'] = false;
-               $this->resetServices();
+               $this->setGroupPermissions( 'autoconfirmed', 'move', false );
+               $this->setGroupPermissions( 'user', 'move', false );
                $this->overrideUserPermissions( $this->user, $userPermsOverrides );
                $res = $this->title->getUserPermissionsErrors( $action, $this->user );
                $this->assertEquals( $result, $res );
 
-               $wgGroupPermissions['autoconfirmed']['move'] = true;
-               $wgGroupPermissions['user']['move'] = false;
-               $this->resetServices();
+               $this->setGroupPermissions( 'autoconfirmed', 'move', true );
+               $this->setGroupPermissions( 'user', 'move', false );
                $this->overrideUserPermissions( $this->user, $userPermsOverrides );
                $res = $this->title->getUserPermissionsErrors( $action, $this->user );
                $this->assertEquals( $result2, $res );
 
-               $wgGroupPermissions['autoconfirmed']['move'] = true;
-               $wgGroupPermissions['user']['move'] = true;
-               $this->resetServices();
+               $this->setGroupPermissions( 'autoconfirmed', 'move', true );
+               $this->setGroupPermissions( 'user', 'move', true );
                $this->overrideUserPermissions( $this->user, $userPermsOverrides );
                $res = $this->title->getUserPermissionsErrors( $action, $this->user );
                $this->assertEquals( $result2, $res );
 
-               $wgGroupPermissions['autoconfirmed']['move'] = false;
-               $wgGroupPermissions['user']['move'] = true;
-               $this->resetServices();
+               $this->setGroupPermissions( 'autoconfirmed', 'move', false );
+               $this->setGroupPermissions( 'user', 'move', true );
                $this->overrideUserPermissions( $this->user, $userPermsOverrides );
                $res = $this->title->getUserPermissionsErrors( $action, $this->user );
                $this->assertEquals( $result2, $res );
@@ -906,7 +896,6 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                        'wgEmailAuthentication' => true,
                        'wgBlockDisablesLogin' => false,
                ] );
-               $this->resetServices();
 
                $this->overrideUserPermissions(
                        $this->user,
@@ -921,7 +910,6 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                        $this->title->getUserPermissionsErrors( 'edit', $this->user ) );
 
                $this->setMwGlobals( 'wgEmailConfirmToEdit', false );
-               $this->resetServices();
                $this->overrideUserPermissions(
                        $this->user,
                        [ 'createpage', 'edit', 'move', 'rollback', 'patrol', 'upload', 'purge' ]
@@ -1088,7 +1076,6 @@ class TitlePermissionTest extends MediaWikiLangTestCase {
                                ],
                        ],
                ] );
-               $this->resetServices();
 
                $now = time();
                $this->user->mBlockedby = $this->user->getName();
index 6cfc377..18faeea 100644 (file)
@@ -150,9 +150,6 @@ class TitleTest extends MediaWikiTestCase {
                                ]
                        ]
                ] );
-
-               // Reset services since we modified $wgLocalInterwikis
-               $this->overrideMwServices();
        }
 
        /**
index c2917b6..2d19d38 100644 (file)
@@ -150,8 +150,6 @@ class ApiBlockTest extends ApiTestCase {
                $this->setMwGlobals( 'wgRevokePermissions',
                        [ 'user' => [ 'applychangetags' => true ] ] );
 
-               $this->resetServices();
-
                $this->doBlock( [ 'tags' => 'custom tag' ] );
        }
 
@@ -162,7 +160,6 @@ class ApiBlockTest extends ApiTestCase {
                $this->mergeMwGlobalArrayValue( 'wgGroupPermissions',
                        [ 'sysop' => $newPermissions ] );
 
-               $this->resetServices();
                $res = $this->doBlock( [ 'hidename' => '' ] );
 
                $dbw = wfGetDB( DB_MASTER );
@@ -212,8 +209,6 @@ class ApiBlockTest extends ApiTestCase {
                $this->setMwGlobals( 'wgRevokePermissions',
                        [ 'sysop' => [ 'blockemail' => true ] ] );
 
-               $this->resetServices();
-
                $this->doBlock( [ 'noemail' => '' ] );
        }
 
index cc5dada..c68954c 100644 (file)
@@ -143,7 +143,6 @@ class ApiDeleteTest extends ApiTestCase {
                ChangeTags::defineTag( 'custom tag' );
                $this->setMwGlobals( 'wgRevokePermissions',
                        [ 'user' => [ 'applychangetags' => true ] ] );
-               $this->resetServices();
 
                $this->editPage( $name, 'Some text' );
 
index 5e5fea3..aafb3a2 100644 (file)
@@ -39,7 +39,6 @@ class ApiEditPageTest extends ApiTestCase {
                        $this->tablesUsed,
                        [ 'change_tag', 'change_tag_def', 'logging' ]
                );
-               $this->resetServices();
        }
 
        public function testEdit() {
@@ -1368,8 +1367,6 @@ class ApiEditPageTest extends ApiTestCase {
                ChangeTags::defineTag( 'custom tag' );
                $this->setMwGlobals( 'wgRevokePermissions',
                        [ 'user' => [ 'applychangetags' => true ] ] );
-               // Supply services with updated globals
-               $this->resetServices();
 
                try {
                        $this->doApiRequestWithToken( [
@@ -1498,8 +1495,6 @@ class ApiEditPageTest extends ApiTestCase {
 
                $this->setMwGlobals( 'wgRevokePermissions',
                        [ 'user' => [ 'upload' => true ] ] );
-               // Supply services with updated globals
-               $this->resetServices();
 
                $this->doApiRequestWithToken( [
                        'action' => 'edit',
@@ -1515,8 +1510,6 @@ class ApiEditPageTest extends ApiTestCase {
                        'The content you supplied exceeds the article size limit of 1 kilobyte.' );
 
                $this->setMwGlobals( 'wgMaxArticleSize', 1 );
-               // Supply services with updated globals
-               $this->resetServices();
 
                $text = str_repeat( '!', 1025 );
 
@@ -1534,8 +1527,6 @@ class ApiEditPageTest extends ApiTestCase {
                        'The action you have requested is limited to users in the group: ' );
 
                $this->setMwGlobals( 'wgRevokePermissions', [ '*' => [ 'edit' => true ] ] );
-               // Supply services with updated globals
-               $this->resetServices();
 
                $this->doApiRequestWithToken( [
                        'action' => 'edit',
@@ -1552,8 +1543,6 @@ class ApiEditPageTest extends ApiTestCase {
 
                $this->setMwGlobals( 'wgRevokePermissions',
                        [ 'user' => [ 'editcontentmodel' => true ] ] );
-               // Supply services with updated globals
-               $this->resetServices();
 
                $this->doApiRequestWithToken( [
                        'action' => 'edit',
index 580efcd..1e2135b 100644 (file)
@@ -141,7 +141,6 @@ class ApiMainTest extends ApiTestCase {
        public function testSetCacheModeUnrecognized() {
                $api = new ApiMain();
                $api->setCacheMode( 'unrecognized' );
-               $this->resetServices();
                $this->assertSame(
                        'private',
                        TestingAccessWrapper::newFromObject( $api )->mCacheMode,
index c98308c..e09e6ad 100644 (file)
@@ -294,7 +294,6 @@ class ApiMoveTest extends ApiTestCase {
                $name = ucfirst( __FUNCTION__ );
 
                $this->mergeMwGlobalArrayValue( 'wgNamespacesWithSubpages', [ NS_MAIN => true ] );
-               $this->resetServices();
 
                $pages = [ $name, "$name/1", "$name/2", "Talk:$name", "Talk:$name/1", "Talk:$name/3" ];
                $ids = [];
index a87160a..06b4cf2 100644 (file)
@@ -121,7 +121,6 @@ class ApiParseTest extends ApiTestCase {
 
                $this->setMwGlobals( 'wgExtraInterlanguageLinkPrefixes', [ 'madeuplanguage' ] );
                $this->tablesUsed[] = 'interwiki';
-               $this->resetServices();
        }
 
        /**
index 0d7ad0c..92804fd 100644 (file)
@@ -37,8 +37,6 @@ class ApiUserrightsTest extends ApiTestCase {
                if ( $remove ) {
                        $this->mergeMwGlobalArrayValue( 'wgRemoveGroups', [ 'bureaucrat' => $remove ] );
                }
-
-               $this->resetServices();
        }
 
        /**
@@ -221,7 +219,6 @@ class ApiUserrightsTest extends ApiTestCase {
                ChangeTags::defineTag( 'custom tag' );
 
                $this->setGroupPermissions( 'user', 'applychangetags', false );
-               $this->resetServices();
 
                $this->doFailedRightsChange(
                        'You do not have permission to apply change tags along with your changes.',
index 92c71bd..301ed10 100644 (file)
@@ -11,13 +11,11 @@ class ApiQueryUserContribsTest extends ApiTestCase {
                global $wgActorTableSchemaMigrationStage;
 
                $reset = new \Wikimedia\ScopedCallback( function ( $v ) {
-                       global $wgActorTableSchemaMigrationStage;
-                       $wgActorTableSchemaMigrationStage = $v;
-                       $this->overrideMwServices();
+                       $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', $v );
                }, [ $wgActorTableSchemaMigrationStage ] );
                // Needs to WRITE_BOTH so READ_OLD tests below work. READ mode here doesn't really matter.
-               $wgActorTableSchemaMigrationStage = SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_NEW;
-               $this->overrideMwServices();
+               $this->setMwGlobals( 'wgActorTableSchemaMigrationStage',
+                       SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_NEW );
 
                $users = [
                        User::newFromName( '192.168.2.2', false ),
@@ -55,7 +53,6 @@ class ApiQueryUserContribsTest extends ApiTestCase {
                $this->markTestSkippedIfDbType( 'sqlite' );
 
                $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', $stage );
-               $this->overrideMwServices();
 
                if ( isset( $params['ucuserids'] ) ) {
                        $params['ucuserids'] = implode( '|', array_map( 'User::idFromName', $params['ucuserids'] ) );
@@ -150,7 +147,6 @@ class ApiQueryUserContribsTest extends ApiTestCase {
         */
        public function testInterwikiUser( $stage ) {
                $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', $stage );
-               $this->overrideMwServices();
 
                $params = [
                        'action' => 'query',
index 16d9d53..f8be1d4 100644 (file)
@@ -1473,12 +1473,10 @@ class AuthManagerTest extends \MediaWikiTestCase {
                        ],
                        'wgProxyWhitelist' => [],
                ] );
-               $this->resetServices();
                $status = $this->manager->checkAccountCreatePermissions( new \User );
                $this->assertFalse( $status->isOK() );
                $this->assertTrue( $status->hasMessage( 'sorbs_create_account_reason' ) );
                $this->setMwGlobals( 'wgProxyWhitelist', [ '127.0.0.1' ] );
-               $this->resetServices();
                $status = $this->manager->checkAccountCreatePermissions( new \User );
                $this->assertTrue( $status->isGood() );
        }
@@ -2366,8 +2364,6 @@ class AuthManagerTest extends \MediaWikiTestCase {
                $this->mergeMwGlobalArrayValue( 'wgObjectCaches',
                        [ __METHOD__ => [ 'class' => 'HashBagOStuff' ] ] );
                $this->setMwGlobals( [ 'wgMainCacheType' => __METHOD__ ] );
-               // Supply services with updated globals
-               $this->resetServices();
 
                // Set up lots of mocks...
                $mocks = [];
index e085d88..d4133b7 100644 (file)
@@ -48,7 +48,6 @@ class BlockManagerTest extends MediaWikiTestCase {
        private function getBlockManagerConstructorArgs( $overrideConfig ) {
                $blockManagerConfig = array_merge( $this->blockManagerConfig, $overrideConfig );
                $this->setMwGlobals( $blockManagerConfig );
-               $this->overrideMwServices();
                return [
                        new LoggedServiceOptions(
                                self::$serviceOptionsAccessLog,
index 74ad84a..7abddd4 100644 (file)
@@ -24,7 +24,6 @@ class MessageCacheTest extends MediaWikiLangTestCase {
                // let's choose e.g. German (de)
                $this->setUserLang( 'de' );
                $this->setContentLang( 'de' );
-               $this->resetServices();
        }
 
        function addDBDataOnce() {
@@ -150,7 +149,6 @@ class MessageCacheTest extends MediaWikiLangTestCase {
                                ]
                        ]
                ] );
-               $this->overrideMwServices();
 
                $messageCache = MessageCache::singleton();
                $messageCache->enable();
index 67de698..04452f2 100644 (file)
@@ -7,7 +7,6 @@ class RepoGroupTest extends MediaWikiTestCase {
 
        function testHasForeignRepoNegative() {
                $this->setMwGlobals( 'wgForeignFileRepos', [] );
-               $this->overrideMwServices();
                FileBackendGroup::destroySingleton();
                $this->assertFalse( RepoGroup::singleton()->hasForeignRepos() );
        }
@@ -27,7 +26,6 @@ class RepoGroupTest extends MediaWikiTestCase {
 
        function testForEachForeignRepoNone() {
                $this->setMwGlobals( 'wgForeignFileRepos', [] );
-               $this->overrideMwServices();
                FileBackendGroup::destroySingleton();
                $fakeCallback = $this->createMock( RepoGroupTestHelper::class );
                $fakeCallback->expects( $this->never() )->method( 'callback' );
@@ -48,7 +46,6 @@ class RepoGroupTest extends MediaWikiTestCase {
                        'apiThumbCacheExpiry' => 86400,
                        'directory' => $wgUploadDirectory
                ] ] );
-               $this->overrideMwServices();
                FileBackendGroup::destroySingleton();
        }
 }
index d2c9a32..88ac923 100644 (file)
@@ -51,7 +51,6 @@ class InterwikiTest extends MediaWikiTestCase {
        }
 
        private function setWgInterwikiCache( $interwikiCache ) {
-               $this->overrideMwServices();
                MediaWikiServices::getInstance()->resetServiceForTesting( 'InterwikiLookup' );
                $this->setMwGlobals( 'wgInterwikiCache', $interwikiCache );
        }
index 9aa0712..7f52ca6 100644 (file)
@@ -102,7 +102,6 @@ class ObjectCacheTest extends MediaWikiTestCase {
 
        /** @covers ObjectCache::newAnything */
        public function testNewAnythingNothingNoDb() {
-               $this->overrideMwServices();
                MediaWiki\MediaWikiServices::disableStorageBackend();
 
                $this->assertInstanceOf(
index 42edf38..bcbc1ed 100644 (file)
@@ -83,13 +83,11 @@ abstract class PageArchiveTestBase extends MediaWikiTestCase {
 
                $this->tablesUsed += $this->getMcrTablesToReset();
 
-               $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW );
-               $this->setMwGlobals( 'wgContentHandlerUseDB', $this->getContentHandlerUseDB() );
-               $this->setMwGlobals(
-                       'wgMultiContentRevisionSchemaMigrationStage',
-                       $this->getMcrMigrationStage()
-               );
-               $this->overrideMwServices();
+               $this->setMwGlobals( [
+                       'wgActorTableSchemaMigrationStage' => SCHEMA_COMPAT_NEW,
+                       'wgContentHandlerUseDB' => $this->getContentHandlerUseDB(),
+                       'wgMultiContentRevisionSchemaMigrationStage' => $this->getMcrMigrationStage(),
+               ] );
 
                // First create our dummy page
                $page = Title::newFromText( 'PageArchiveTest_thePage' );
index 30973c8..f071e4b 100644 (file)
@@ -65,8 +65,6 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase {
                        $this->getMcrMigrationStage()
                );
                $this->pagesToDelete = [];
-
-               $this->overrideMwServices();
        }
 
        protected function tearDown() {
index ac4a1ca..428778e 100644 (file)
@@ -18,8 +18,6 @@ class ResourceLoaderTest extends ResourceLoaderTestCase {
         * @coversNothing
         */
        public function testServiceWiring() {
-               $this->overrideMwServices();
-
                $ranHook = 0;
                $this->setMwGlobals( 'wgHooks', [
                        'ResourceLoaderRegisterModules' => [
index 372cb33..ed75076 100644 (file)
@@ -68,8 +68,6 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
 
                $this->originalHandlers = TestingAccessWrapper::newFromClass( Hooks::class )->handlers;
                TestingAccessWrapper::newFromClass( Hooks::class )->handlers = [];
-
-               $this->overrideMwServices();
        }
 
        public function tearDown() {
index 9d58cef..68433c6 100644 (file)
@@ -225,7 +225,6 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
 
        public function testRcHidemyselfFilter() {
                $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW );
-               $this->overrideMwServices();
 
                $user = $this->getTestUser()->getUser();
                $user->getActorId( wfGetDB( DB_MASTER ) );
@@ -258,7 +257,6 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
                $this->setMwGlobals(
                        'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
                );
-               $this->overrideMwServices();
 
                $user = $this->getTestUser()->getUser();
                $user->getActorId( wfGetDB( DB_MASTER ) );
@@ -289,7 +287,6 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
 
        public function testRcHidebyothersFilter() {
                $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW );
-               $this->overrideMwServices();
 
                $user = $this->getTestUser()->getUser();
                $user->getActorId( wfGetDB( DB_MASTER ) );
@@ -322,7 +319,6 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
                $this->setMwGlobals(
                        'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
                );
-               $this->overrideMwServices();
 
                $user = $this->getTestUser()->getUser();
                $user->getActorId( wfGetDB( DB_MASTER ) );
@@ -555,7 +551,6 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
 
        public function testFilterUserExpLevelAllExperienceLevels() {
                $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW );
-               $this->overrideMwServices();
 
                $this->assertConditions(
                        [
@@ -573,7 +568,6 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
                $this->setMwGlobals(
                        'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
                );
-               $this->overrideMwServices();
 
                $this->assertConditions(
                        [
@@ -589,7 +583,6 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
 
        public function testFilterUserExpLevelRegistrered() {
                $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW );
-               $this->overrideMwServices();
 
                $this->assertConditions(
                        [
@@ -607,7 +600,6 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
                $this->setMwGlobals(
                        'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
                );
-               $this->overrideMwServices();
 
                $this->assertConditions(
                        [
@@ -623,7 +615,6 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
 
        public function testFilterUserExpLevelUnregistrered() {
                $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW );
-               $this->overrideMwServices();
 
                $this->assertConditions(
                        [
@@ -641,7 +632,6 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
                $this->setMwGlobals(
                        'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
                );
-               $this->overrideMwServices();
 
                $this->assertConditions(
                        [
@@ -657,7 +647,6 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
 
        public function testFilterUserExpLevelRegistreredOrLearner() {
                $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW );
-               $this->overrideMwServices();
 
                $this->assertConditions(
                        [
@@ -675,7 +664,6 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
                $this->setMwGlobals(
                        'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
                );
-               $this->overrideMwServices();
 
                $this->assertConditions(
                        [
@@ -691,7 +679,6 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
 
        public function testFilterUserExpLevelUnregistreredOrExperienced() {
                $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW );
-               $this->overrideMwServices();
 
                $conds = $this->buildQuery( [ 'userExpLevel' => 'unregistered;experienced' ] );
 
@@ -707,7 +694,6 @@ class ChangesListSpecialPageTest extends AbstractChangesListSpecialPageTestCase
                $this->setMwGlobals(
                        'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
                );
-               $this->overrideMwServices();
 
                $conds = $this->buildQuery( [ 'userExpLevel' => 'unregistered;experienced' ] );
 
index 04a89d2..c0376ad 100644 (file)
@@ -33,7 +33,6 @@ class SpecialPageFactoryTest extends MediaWikiTestCase {
                                        $count++;
                                }
                ] ] );
-               $this->overrideMwServices();
                $spf = MediaWikiServices::getInstance()->getSpecialPageFactory();
                $spf->getNames();
                $spf->getNames();
@@ -71,7 +70,6 @@ class SpecialPageFactoryTest extends MediaWikiTestCase {
         */
        public function testGetPage( $spec, $shouldReuseInstance ) {
                $this->mergeMwGlobalArrayValue( 'wgSpecialPages', [ 'testdummy' => $spec ] );
-               $this->overrideMwServices();
 
                $page = SpecialPageFactory::getPage( 'testdummy' );
                $this->assertInstanceOf( SpecialPage::class, $page );
@@ -85,7 +83,6 @@ class SpecialPageFactoryTest extends MediaWikiTestCase {
         */
        public function testGetNames() {
                $this->mergeMwGlobalArrayValue( 'wgSpecialPages', [ 'testdummy' => SpecialAllPages::class ] );
-               $this->overrideMwServices();
 
                $names = SpecialPageFactory::getNames();
                $this->assertInternalType( 'array', $names );
@@ -97,7 +94,6 @@ class SpecialPageFactoryTest extends MediaWikiTestCase {
         */
        public function testResolveAlias() {
                $this->setContentLang( 'de' );
-               $this->overrideMwServices();
 
                list( $name, $param ) = SpecialPageFactory::resolveAlias( 'Spezialseiten/Foo' );
                $this->assertEquals( 'Specialpages', $name );
@@ -109,7 +105,6 @@ class SpecialPageFactoryTest extends MediaWikiTestCase {
         */
        public function testGetLocalNameFor() {
                $this->setContentLang( 'de' );
-               $this->overrideMwServices();
 
                $name = SpecialPageFactory::getLocalNameFor( 'Specialpages', 'Foo' );
                $this->assertEquals( 'Spezialseiten/Foo', $name );
@@ -120,7 +115,6 @@ class SpecialPageFactoryTest extends MediaWikiTestCase {
         */
        public function testGetTitleForAlias() {
                $this->setContentLang( 'de' );
-               $this->overrideMwServices();
 
                $title = SpecialPageFactory::getTitleForAlias( 'Specialpages/Foo' );
                $this->assertEquals( 'Spezialseiten/Foo', $title->getText() );
@@ -138,7 +132,6 @@ class SpecialPageFactoryTest extends MediaWikiTestCase {
                $this->setMwGlobals( 'wgSpecialPages',
                        array_combine( array_keys( $aliasesList ), array_keys( $aliasesList ) )
                );
-               $this->overrideMwServices();
                $this->setContentLang( $lang );
 
                // Catch the warnings we expect to be raised
@@ -267,7 +260,6 @@ class SpecialPageFactoryTest extends MediaWikiTestCase {
                                }
                        ],
                ] );
-               $this->overrideMwServices();
                SpecialPageFactory::getLocalNameFor( 'Specialpages' );
                $this->assertTrue( $called, 'Recursive call succeeded' );
        }
index 7f97a16..03ba960 100644 (file)
@@ -1275,7 +1275,6 @@ class NamespaceInfoTest extends MediaWikiTestCase {
                        'wgRestrictionLevels' => [ '', 'autoconfirmed', 'sysop' ],
                        'wgAutopromote' => []
                ] );
-               $this->resetServices();
                $obj = $this->newObj();
                $user = is_null( $groups ) ? null : $this->getTestUser( $groups )->getUser();
                $this->assertSame( $expected, $obj->getRestrictionLevels( $ns, $user ) );
index 340a4c3..4862747 100644 (file)
@@ -46,8 +46,6 @@ class UserGroupMembershipTest extends MediaWikiTestCase {
                $this->userTester->addGroup( 'unittesters' );
                $this->expiryTime = wfTimestamp( TS_MW, time() + 100500 );
                $this->userTester->addGroup( 'testwriters', $this->expiryTime );
-
-               $this->resetServices();
        }
 
        /**
index 9ff0521..2d87c78 100644 (file)
@@ -33,7 +33,6 @@ class UserTest extends MediaWikiTestCase {
                        'wgRevokePermissions' => [],
                        'wgActorTableSchemaMigrationStage' => SCHEMA_COMPAT_NEW,
                ] );
-               $this->overrideMwServices();
 
                $this->setUpPermissionGlobals();
 
@@ -73,7 +72,6 @@ class UserTest extends MediaWikiTestCase {
                RequestContext::getMain()->setRequest( $request );
                TestingAccessWrapper::newFromObject( $user )->mRequest = $request;
                $request->getSession()->setUser( $user );
-               $this->overrideMwServices();
        }
 
        /**
@@ -136,7 +134,6 @@ class UserTest extends MediaWikiTestCase {
                        $rights = array_diff( $rights, [ 'writetest' ] );
                } );
 
-               $this->resetServices();
                $rights = $user->getRights();
                $this->assertContains( 'test', $rights );
                $this->assertContains( 'runtest', $rights );
@@ -1091,7 +1088,6 @@ class UserTest extends MediaWikiTestCase {
                $this->setMwGlobals( [
                        'wgActorTableSchemaMigrationStage' => SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD,
                ] );
-               $this->overrideMwServices();
 
                $domain = MediaWikiServices::getInstance()->getDBLoadBalancer()->getLocalDomainID();
                $this->hideDeprecated( 'User::selectFields' );
index 37fa030..a46f25d 100644 (file)
@@ -212,7 +212,6 @@ class MediaWikiTestCaseTest extends MediaWikiTestCase {
 
                // the actual test: change config, reset services.
                $this->setMwGlobals( 'wgLanguageCode', 'qqx' );
-               $this->resetServices();
 
                // the overridden service instance should still be there
                $this->assertSame( $myReadOnlyMode, $services->getService( 'ReadOnlyMode' ) );