MediaWiki REL1_31
TitleBlacklistPreAuthenticationProviderTest.php
Go to the documentation of this file.
1<?php
3
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 ) {
23 $provider->setManager( AuthManager::singleton() );
24 $reqs = $provider->getAuthenticationRequests( $action, [ 'username' => $username ] );
25 $this->assertEquals( $expectedReqs, $reqs );
26 }
27
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}
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:785