mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TitleBlacklist
synced 2024-12-01 00:56:33 +00:00
1243bed54d
This required MediaWiki 1.35 Change-Id: I40b1cfd33427cb0c0cc3b484525997f1d2263562
31 lines
1,002 B
PHP
31 lines
1,002 B
PHP
<?php
|
|
|
|
use MediaWiki\Auth\AuthManager;
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
/**
|
|
* @group Database
|
|
* @covers TitleBlacklistPreAuthenticationProvider
|
|
*/
|
|
class TitleBlacklistPreAuthenticationProviderTest extends MediaWikiTestCase {
|
|
/**
|
|
* @dataProvider provideGetAuthenticationRequests
|
|
*/
|
|
public function testGetAuthenticationRequests( $action, $username, $expectedReqs ) {
|
|
$provider = new TitleBlacklistPreAuthenticationProvider();
|
|
$provider->setManager( MediaWikiServices::getInstance()->getAuthManager() );
|
|
$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, [] ],
|
|
];
|
|
}
|
|
}
|