protected $managerPriv;
protected function setUp() {
- global $wgDisableAuthManager;
-
parent::setUp();
- if ( $wgDisableAuthManager ) {
- $this->markTestSkipped( '$wgDisableAuthManager is set' );
- }
$this->setMwGlobals( [ 'wgAuth' => null ] );
$this->stashMwGlobals( [ 'wgHooks' ] );
\RequestContext::getMain()->getConfig(),
\TestingAccessWrapper::newFromObject( $singleton )->config
);
-
- $this->setMwGlobals( [ 'wgDisableAuthManager' => true ] );
- try {
- AuthManager::singleton();
- $this->fail( 'Expected exception not thrown' );
- } catch ( \BadMethodCallException $ex ) {
- $this->assertSame( '$wgDisableAuthManager is set', $ex->getMessage() );
- }
}
public function testCanAuthenticateNow() {
$actual = $this->manager->getAuthenticationRequests( AuthManager::ACTION_LOGIN );
$expected = [
$rememberReq,
- $makeReq( "primary-shared", AuthenticationRequest::REQUIRED ),
+ $makeReq( "primary-shared", AuthenticationRequest::PRIMARY_REQUIRED ),
$makeReq( "required", AuthenticationRequest::PRIMARY_REQUIRED ),
$makeReq( "required2", AuthenticationRequest::PRIMARY_REQUIRED ),
$makeReq( "optional", AuthenticationRequest::OPTIONAL ),
$actual = $this->manager->getAuthenticationRequests( AuthManager::ACTION_LOGIN );
$expected = [
$rememberReq,
- $makeReq( "primary-shared", AuthenticationRequest::REQUIRED ),
- $makeReq( "required", AuthenticationRequest::REQUIRED ),
+ $makeReq( "primary-shared", AuthenticationRequest::PRIMARY_REQUIRED ),
+ $makeReq( "required", AuthenticationRequest::PRIMARY_REQUIRED ),
$makeReq( "optional", AuthenticationRequest::OPTIONAL ),
- $makeReq( "foo", AuthenticationRequest::REQUIRED ),
+ $makeReq( "foo", AuthenticationRequest::PRIMARY_REQUIRED ),
$makeReq( "bar", AuthenticationRequest::REQUIRED ),
$makeReq( "baz", AuthenticationRequest::REQUIRED ),
];