MediaWiki REL1_30
TitleBlacklistPreAuthenticationProviderTest.php
Go to the documentation of this file.
1<?php
3
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 ) {
22 $provider->setManager( AuthManager::singleton() );
23 $reqs = $provider->getAuthenticationRequests( $action, [ 'username' => $username ] );
24 $this->assertEquals( $expectedReqs, $reqs );
25 }
26
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}
This serves as the entry point to the authentication system.
An authentication request that allows users with sufficiently high privileges to skip the title black...
testGetAuthenticationRequests( $action, $username, $expectedReqs)
provideGetAuthenticationRequests
this hook is for auditing only or null if authentication failed before getting that far $username
Definition hooks.txt:783