Merge "tests: stop updating the search engine"
[lhc/web/wiklou.git] / tests / phpunit / includes / auth / AuthManagerTest.php
index dc6fc62..f57db11 100644 (file)
@@ -6,6 +6,7 @@ use MediaWiki\Session\SessionInfo;
 use MediaWiki\Session\UserInfo;
 use Psr\Log\LogLevel;
 use StatusValue;
+use Wikimedia\ScopedCallback;
 
 /**
  * @group AuthManager
@@ -184,7 +185,7 @@ class AuthManagerTest extends \MediaWikiTestCase {
                $rProp = new \ReflectionProperty( AuthManager::class, 'instance' );
                $rProp->setAccessible( true );
                $old = $rProp->getValue();
-               $cb = new \ScopedCallback( [ $rProp, 'setValue' ], [ $old ] );
+               $cb = new ScopedCallback( [ $rProp, 'setValue' ], [ $old ] );
                $rProp->setValue( null );
 
                $singleton = AuthManager::singleton();
@@ -202,11 +203,11 @@ class AuthManagerTest extends \MediaWikiTestCase {
 
                list( $provider, $reset ) = $this->getMockSessionProvider( false );
                $this->assertFalse( $this->manager->canAuthenticateNow() );
-               \ScopedCallback::consume( $reset );
+               ScopedCallback::consume( $reset );
 
                list( $provider, $reset ) = $this->getMockSessionProvider( true );
                $this->assertTrue( $this->manager->canAuthenticateNow() );
-               \ScopedCallback::consume( $reset );
+               ScopedCallback::consume( $reset );
        }
 
        public function testNormalizeUsername() {
@@ -385,7 +386,7 @@ class AuthManagerTest extends \MediaWikiTestCase {
                        $this->unhook( 'SecuritySensitiveOperationStatus' );
                }
 
-               \ScopedCallback::consume( $reset );
+               ScopedCallback::consume( $reset );
        }
 
        public function onSecuritySensitiveOperationStatus( &$status, $operation, $session, $time ) {
@@ -585,7 +586,7 @@ class AuthManagerTest extends \MediaWikiTestCase {
                $this->initializeManager();
 
                $context = \RequestContext::getMain();
-               $reset = new \ScopedCallback( [ $context, 'setLanguage' ], [ $context->getLanguage() ] );
+               $reset = new ScopedCallback( [ $context, 'setLanguage' ], [ $context->getLanguage() ] );
                $context->setLanguage( 'de' );
                $this->setMwGlobals( 'wgContLang', \Language::factory( 'zh' ) );
 
@@ -694,7 +695,6 @@ class AuthManagerTest extends \MediaWikiTestCase {
                                $ex->getMessage()
                        );
                }
-
        }
 
        public function testBeginAuthentication() {
@@ -712,7 +712,7 @@ class AuthManagerTest extends \MediaWikiTestCase {
                }
                $this->unhook( 'UserLoggedIn' );
                $this->assertNull( $this->request->getSession()->getSecret( 'AuthManager::authnState' ) );
-               \ScopedCallback::consume( $reset );
+               ScopedCallback::consume( $reset );
                $this->initializeManager( true );
 
                // CreatedAccountAuthenticationRequest
@@ -1449,11 +1449,11 @@ class AuthManagerTest extends \MediaWikiTestCase {
                ];
                $block = new \Block( $blockOptions );
                $block->insert();
-               $scopeVariable = new \ScopedCallback( [ $block, 'delete' ] );
+               $scopeVariable = new ScopedCallback( [ $block, 'delete' ] );
                $status = $this->manager->checkAccountCreatePermissions( new \User );
                $this->assertFalse( $status->isOK() );
                $this->assertTrue( $status->hasMessage( 'cantcreateaccount-range-text' ) );
-               \ScopedCallback::consume( $scopeVariable );
+               ScopedCallback::consume( $scopeVariable );
 
                $this->setMwGlobals( [
                        'wgEnableDnsBlacklist' => true,
@@ -3264,7 +3264,6 @@ class AuthManagerTest extends \MediaWikiTestCase {
                $this->manager->removeAuthenticationSessionData( null );
                $this->assertNull( $this->manager->getAuthenticationSessionData( 'foo' ) );
                $this->assertNull( $this->manager->getAuthenticationSessionData( 'bar' ) );
-
        }
 
        public function testCanLinkAccounts() {