From 3025d83afcc4c95589de3a0e74ac2bedd1539949 Mon Sep 17 00:00:00 2001 From: vladshapik Date: Fri, 7 May 2021 15:33:56 +0300 Subject: [PATCH] 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 --- extension.json | 2 +- .../TitleBlacklistPreAuthenticationProviderTest.php | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/extension.json b/extension.json index 77509180..98e09864 100644 --- a/extension.json +++ b/extension.json @@ -10,7 +10,7 @@ "license-name": "GPL-2.0-or-later", "type": "antispam", "requires": { - "MediaWiki": ">= 1.35.0" + "MediaWiki": ">= 1.37.0" }, "GroupPermissions": { "sysop": { diff --git a/tests/phpunit/TitleBlacklistPreAuthenticationProviderTest.php b/tests/phpunit/TitleBlacklistPreAuthenticationProviderTest.php index 5145e38f..219176bb 100644 --- a/tests/phpunit/TitleBlacklistPreAuthenticationProviderTest.php +++ b/tests/phpunit/TitleBlacklistPreAuthenticationProviderTest.php @@ -1,19 +1,21 @@ setManager( MediaWikiServices::getInstance()->getAuthManager() ); + $this->initProvider( $provider, null, null, $this->getServiceContainer()->getAuthManager() ); $reqs = $provider->getAuthenticationRequests( $action, [ 'username' => $username ] ); $this->assertEquals( $expectedReqs, $reqs ); }