Merge "Selenium: replace UserLoginPage with BlankPage where possible"
[lhc/web/wiklou.git] / tests / phpunit / includes / auth / AuthManagerTest.php
index ea45b19..fc6f688 100644 (file)
@@ -1420,7 +1420,6 @@ class AuthManagerTest extends \MediaWikiTestCase {
                $readOnlyMode->setReason( false );
 
                $this->setGroupPermissions( '*', 'createaccount', false );
-               $this->overrideMwServices();
                $status = $this->manager->checkAccountCreatePermissions( new \User );
                $this->assertFalse( $status->isOK() );
                $this->assertTrue( $status->hasMessage( 'badaccess-groups' ) );
@@ -1447,7 +1446,7 @@ class AuthManagerTest extends \MediaWikiTestCase {
                ];
                $block = new DatabaseBlock( $blockOptions );
                $block->insert();
-               $this->overrideMwServices();
+               $this->resetServices();
                $status = $this->manager->checkAccountCreatePermissions( $user );
                $this->assertFalse( $status->isOK() );
                $this->assertTrue( $status->hasMessage( 'cantcreateaccount-text' ) );
@@ -1474,12 +1473,12 @@ class AuthManagerTest extends \MediaWikiTestCase {
                        ],
                        'wgProxyWhitelist' => [],
                ] );
-               $this->overrideMwServices();
+               $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->overrideMwServices();
+               $this->resetServices();
                $status = $this->manager->checkAccountCreatePermissions( new \User );
                $this->assertTrue( $status->isGood() );
        }
@@ -2368,7 +2367,7 @@ class AuthManagerTest extends \MediaWikiTestCase {
                        [ __METHOD__ => [ 'class' => 'HashBagOStuff' ] ] );
                $this->setMwGlobals( [ 'wgMainCacheType' => __METHOD__ ] );
                // Supply services with updated globals
-               $this->overrideMwServices();
+               $this->resetServices();
 
                // Set up lots of mocks...
                $mocks = [];
@@ -2553,7 +2552,6 @@ class AuthManagerTest extends \MediaWikiTestCase {
                // IP unable to create accounts
                $this->setGroupPermissions( '*', 'createaccount', false );
                $this->setGroupPermissions( '*', 'autocreateaccount', false );
-               $this->overrideMwServices();
                $session->clear();
                $user = \User::newFromName( $username );
                $this->hook( 'LocalUserCreated', $this->never() );
@@ -2590,7 +2588,6 @@ class AuthManagerTest extends \MediaWikiTestCase {
                $session->clear();
                $user = \User::newFromName( $username );
                $this->hook( 'LocalUserCreated', $this->never() );
-               $this->overrideMwServices();
                $ret = $this->manager->autoCreateUser( $user, AuthManager::AUTOCREATE_SOURCE_SESSION, true );
                $this->unhook( 'LocalUserCreated' );
                $this->assertEquals( \Status::newFatal( 'ok' ), $ret );