mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TitleBlacklist
synced 2024-12-18 08:31:01 +00:00
Replace uses of the deprecated setters of AbstractAuthenticationProvider
Since AbstractAuthenticationProvider ::setLogger, ::setManager, ::setConfig, ::setHookContainer methods had been soft deprecated, so its usages were removed. AuthenticationProviderTestTrait ::initProvider was used in order to initialize TitleBlacklistPreAuthenticationProvider in the test. * Also bump required MW version to 1.37.0 Bug: T281994 Change-Id: I15b811a8596addad7a50b13d978851ebd86da9a5
This commit is contained in:
parent
942ff96c7f
commit
3025d83afc
|
@ -10,7 +10,7 @@
|
|||
"license-name": "GPL-2.0-or-later",
|
||||
"type": "antispam",
|
||||
"requires": {
|
||||
"MediaWiki": ">= 1.35.0"
|
||||
"MediaWiki": ">= 1.37.0"
|
||||
},
|
||||
"GroupPermissions": {
|
||||
"sysop": {
|
||||
|
|
|
@ -1,19 +1,21 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\Auth\AuthManager;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\Tests\Unit\Auth\AuthenticationProviderTestTrait;
|
||||
|
||||
/**
|
||||
* @group Database
|
||||
* @covers TitleBlacklistPreAuthenticationProvider
|
||||
*/
|
||||
class TitleBlacklistPreAuthenticationProviderTest extends MediaWikiTestCase {
|
||||
class TitleBlacklistPreAuthenticationProviderTest extends MediaWikiIntegrationTestCase {
|
||||
use AuthenticationProviderTestTrait;
|
||||
|
||||
/**
|
||||
* @dataProvider provideGetAuthenticationRequests
|
||||
*/
|
||||
public function testGetAuthenticationRequests( $action, $username, $expectedReqs ) {
|
||||
$provider = new TitleBlacklistPreAuthenticationProvider();
|
||||
$provider->setManager( MediaWikiServices::getInstance()->getAuthManager() );
|
||||
$this->initProvider( $provider, null, null, $this->getServiceContainer()->getAuthManager() );
|
||||
$reqs = $provider->getAuthenticationRequests( $action, [ 'username' => $username ] );
|
||||
$this->assertEquals( $expectedReqs, $reqs );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue