MediaWiki REL1_32
AbstractPreAuthenticationProviderTest.php
Go to the documentation of this file.
1<?php
2
3namespace MediaWiki\Auth;
4
11 $user = \User::newFromName( 'UTSysop' );
12
13 $provider = $this->getMockForAbstractClass( AbstractPreAuthenticationProvider::class );
14
15 $this->assertEquals(
16 [],
17 $provider->getAuthenticationRequests( AuthManager::ACTION_LOGIN, [] )
18 );
19 $this->assertEquals(
20 \StatusValue::newGood(),
21 $provider->testForAuthentication( [] )
22 );
23 $this->assertEquals(
24 \StatusValue::newGood(),
25 $provider->testForAccountCreation( $user, $user, [] )
26 );
27 $this->assertEquals(
28 \StatusValue::newGood(),
29 $provider->testUserForCreation( $user, AuthManager::AUTOCREATE_SOURCE_SESSION )
30 );
31 $this->assertEquals(
32 \StatusValue::newGood(),
33 $provider->testUserForCreation( $user, false )
34 );
35 $this->assertEquals(
36 \StatusValue::newGood(),
37 $provider->testForAccountLink( $user )
38 );
39
41 $provider->postAuthentication( $user, $res );
42 $provider->postAccountCreation( $user, $user, $res );
43 $provider->postAccountLink( $user, $res );
44 }
45}
AuthManager MediaWiki\Auth\AbstractPreAuthenticationProvider.
const AUTOCREATE_SOURCE_SESSION
Auto-creation is due to SessionManager.
const ACTION_LOGIN
Log in with an existing (not necessarily local) user.
$res
Definition database.txt:21