mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TitleBlacklist
synced 2024-11-28 16:00:37 +00:00
277c88d44d
This global from MediaWiki was removed in 854a462 in 2016 but we didn't clean up after it at the time. Change-Id: I48f5d104e5350bd2ac170afc155015b8060e2ed5
29 lines
942 B
PHP
29 lines
942 B
PHP
<?php
|
|
use MediaWiki\Auth\AuthManager;
|
|
|
|
/**
|
|
* @group Database
|
|
* @covers TitleBlacklistPreAuthenticationProvider
|
|
*/
|
|
class TitleBlacklistPreAuthenticationProviderTest extends MediaWikiTestCase {
|
|
/**
|
|
* @dataProvider provideGetAuthenticationRequests
|
|
*/
|
|
public function testGetAuthenticationRequests( $action, $username, $expectedReqs ) {
|
|
$provider = new TitleBlacklistPreAuthenticationProvider();
|
|
$provider->setManager( AuthManager::singleton() );
|
|
$reqs = $provider->getAuthenticationRequests( $action, [ 'username' => $username ] );
|
|
$this->assertEquals( $expectedReqs, $reqs );
|
|
}
|
|
|
|
public function provideGetAuthenticationRequests() {
|
|
return [
|
|
[ AuthManager::ACTION_LOGIN, null, [] ],
|
|
[ AuthManager::ACTION_CREATE, null, [] ],
|
|
[ AuthManager::ACTION_CREATE, 'UTSysop', [ new TitleBlacklistAuthenticationRequest() ] ],
|
|
[ AuthManager::ACTION_CHANGE, null, [] ],
|
|
[ AuthManager::ACTION_REMOVE, null, [] ],
|
|
];
|
|
}
|
|
}
|