use MediaWiki\Session\UserInfo;
use Psr\Log\LogLevel;
use StatusValue;
+use Wikimedia\ScopedCallback;
/**
* @group AuthManager
$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();
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() {
$this->unhook( 'SecuritySensitiveOperationStatus' );
}
- \ScopedCallback::consume( $reset );
+ ScopedCallback::consume( $reset );
}
public function onSecuritySensitiveOperationStatus( &$status, $operation, $session, $time ) {
$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' ) );
$ex->getMessage()
);
}
-
}
public function testBeginAuthentication() {
}
$this->unhook( 'UserLoggedIn' );
$this->assertNull( $this->request->getSession()->getSecret( 'AuthManager::authnState' ) );
- \ScopedCallback::consume( $reset );
+ ScopedCallback::consume( $reset );
$this->initializeManager( true );
// CreatedAccountAuthenticationRequest
];
$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,
$this->manager->removeAuthenticationSessionData( null );
$this->assertNull( $this->manager->getAuthenticationSessionData( 'foo' ) );
$this->assertNull( $this->manager->getAuthenticationSessionData( 'bar' ) );
-
}
public function testCanLinkAccounts() {