MediaWiki
REL1_30
TitleBlacklistPreAuthenticationProviderTest.php
Go to the documentation of this file.
1
<?php
2
use
MediaWiki\Auth\AuthManager
;
3
7
class
TitleBlacklistPreAuthenticationProviderTest
extends
MediaWikiTestCase
{
8
public
function
setUp
() {
9
global $wgDisableAuthManager;
10
if
( !class_exists( AuthManager::class ) || $wgDisableAuthManager ) {
11
$this->markTestSkipped(
'AuthManager is disabled'
);
12
}
13
14
parent::setUp();
15
}
16
20
public
function
testGetAuthenticationRequests
( $action,
$username
, $expectedReqs ) {
21
$provider =
new
TitleBlacklistPreAuthenticationProvider
();
22
$provider->setManager( AuthManager::singleton() );
23
$reqs = $provider->getAuthenticationRequests( $action, [
'username'
=>
$username
] );
24
$this->assertEquals( $expectedReqs, $reqs );
25
}
26
27
public
function
provideGetAuthenticationRequests
() {
28
return
[
29
[ AuthManager::ACTION_LOGIN,
null
, [] ],
30
[ AuthManager::ACTION_CREATE,
null
, [] ],
31
[ AuthManager::ACTION_CREATE,
'UTSysop'
, [
new
TitleBlacklistAuthenticationRequest
() ] ],
32
[ AuthManager::ACTION_CHANGE,
null
, [] ],
33
[ AuthManager::ACTION_REMOVE,
null
, [] ],
34
];
35
}
36
}
MediaWikiTestCase
Definition
MediaWikiTestCase.php:15
MediaWiki\Auth\AuthManager
This serves as the entry point to the authentication system.
Definition
AuthManager.php:82
TitleBlacklistAuthenticationRequest
An authentication request that allows users with sufficiently high privileges to skip the title black...
Definition
TitleBlacklistAuthenticationRequest.php:9
TitleBlacklistPreAuthenticationProviderTest
Database.
Definition
TitleBlacklistPreAuthenticationProviderTest.php:7
TitleBlacklistPreAuthenticationProviderTest\setUp
setUp()
Definition
TitleBlacklistPreAuthenticationProviderTest.php:8
TitleBlacklistPreAuthenticationProviderTest\provideGetAuthenticationRequests
provideGetAuthenticationRequests()
Definition
TitleBlacklistPreAuthenticationProviderTest.php:27
TitleBlacklistPreAuthenticationProviderTest\testGetAuthenticationRequests
testGetAuthenticationRequests( $action, $username, $expectedReqs)
provideGetAuthenticationRequests
Definition
TitleBlacklistPreAuthenticationProviderTest.php:20
TitleBlacklistPreAuthenticationProvider
Definition
TitleBlacklistPreAuthenticationProvider.php:7
$username
this hook is for auditing only or null if authentication failed before getting that far $username
Definition
hooks.txt:783
extensions
TitleBlacklist
tests
phpunit
TitleBlacklistPreAuthenticationProviderTest.php
Generated on Mon Nov 25 2024 15:42:01 for MediaWiki by
1.10.0