The name change happened some time ago, and I think its about time to start using the name name! (Done with a find and replace) My personal motivation for doing this is that I have started trying out vscode as an IDE for mediawiki development, and right now it doesn't appear to handle php aliases very well or at all. Change-Id: I412235d91ae26e4c1c6a62e0dbb7e7cf3c5ed4a6
45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace MediaWiki\Auth;
|
|
|
|
/**
|
|
* @group AuthManager
|
|
* @covers \MediaWiki\Auth\AbstractPreAuthenticationProvider
|
|
*/
|
|
class AbstractPreAuthenticationProviderTest extends \MediaWikiIntegrationTestCase {
|
|
public function testAbstractPreAuthenticationProvider() {
|
|
$user = \User::newFromName( 'UTSysop' );
|
|
|
|
$provider = $this->getMockForAbstractClass( AbstractPreAuthenticationProvider::class );
|
|
|
|
$this->assertEquals(
|
|
[],
|
|
$provider->getAuthenticationRequests( AuthManager::ACTION_LOGIN, [] )
|
|
);
|
|
$this->assertEquals(
|
|
\StatusValue::newGood(),
|
|
$provider->testForAuthentication( [] )
|
|
);
|
|
$this->assertEquals(
|
|
\StatusValue::newGood(),
|
|
$provider->testForAccountCreation( $user, $user, [] )
|
|
);
|
|
$this->assertEquals(
|
|
\StatusValue::newGood(),
|
|
$provider->testUserForCreation( $user, AuthManager::AUTOCREATE_SOURCE_SESSION )
|
|
);
|
|
$this->assertEquals(
|
|
\StatusValue::newGood(),
|
|
$provider->testUserForCreation( $user, false )
|
|
);
|
|
$this->assertEquals(
|
|
\StatusValue::newGood(),
|
|
$provider->testForAccountLink( $user )
|
|
);
|
|
|
|
$res = AuthenticationResponse::newPass();
|
|
$provider->postAuthentication( $user, $res );
|
|
$provider->postAccountCreation( $user, $user, $res );
|
|
$provider->postAccountLink( $user, $res );
|
|
}
|
|
}
|