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