3 namespace MediaWiki\Auth
;
7 * @covers MediaWiki\Auth\AbstractPreAuthenticationProvider
9 class AbstractPreAuthenticationProviderTest
extends \MediaWikiTestCase
{
10 public function testAbstractPreAuthenticationProvider() {
11 $user = \User
::newFromName( 'UTSysop' );
13 $provider = $this->getMockForAbstractClass( AbstractPreAuthenticationProvider
::class );
17 $provider->getAuthenticationRequests( AuthManager
::ACTION_LOGIN
, [] )
20 \StatusValue
::newGood(),
21 $provider->testForAuthentication( [] )
24 \StatusValue
::newGood(),
25 $provider->testForAccountCreation( $user, $user, [] )
28 \StatusValue
::newGood(),
29 $provider->testUserForCreation( $user, AuthManager
::AUTOCREATE_SOURCE_SESSION
)
32 \StatusValue
::newGood(),
33 $provider->testUserForCreation( $user, false )
36 \StatusValue
::newGood(),
37 $provider->testForAccountLink( $user )
40 $res = AuthenticationResponse
::newPass();
41 $provider->postAuthentication( $user, $res );
42 $provider->postAccountCreation( $user, $user, $res );
43 $provider->postAccountLink( $user, $res );