diff options
Diffstat (limited to 'AntiSpoof/tests/phpunit/AntiSpoofPreAuthenticationProviderTest.php')
-rw-r--r-- | AntiSpoof/tests/phpunit/AntiSpoofPreAuthenticationProviderTest.php | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/AntiSpoof/tests/phpunit/AntiSpoofPreAuthenticationProviderTest.php b/AntiSpoof/tests/phpunit/AntiSpoofPreAuthenticationProviderTest.php index 2a0c56f2..b20bbe19 100644 --- a/AntiSpoof/tests/phpunit/AntiSpoofPreAuthenticationProviderTest.php +++ b/AntiSpoof/tests/phpunit/AntiSpoofPreAuthenticationProviderTest.php @@ -1,28 +1,20 @@ <?php use MediaWiki\Auth\AuthManager; +use MediaWiki\MediaWikiServices; /** * @covers AntiSpoofPreAuthenticationProvider * @group Database */ class AntiSpoofPreAuthenticationProviderTest extends MediaWikiTestCase { - public function setUp() { - global $wgDisableAuthManager; - if ( !class_exists( AuthManager::class ) || $wgDisableAuthManager ) { - $this->markTestSkipped( 'AuthManager is disabled' ); - } - - parent::setUp(); - } - /** * @dataProvider provideGetAuthenticationRequests */ public function testGetAuthenticationRequests( $action, $params, $username, $expectedReqs ) { $this->setMwGlobals( 'wgAntiSpoofAccounts', false ); $provider = new AntiSpoofPreAuthenticationProvider( $params ); - $provider->setManager( AuthManager::singleton() ); + $provider->setManager( MediaWikiServices::getInstance()->getAuthManager() ); $reqs = $provider->getAuthenticationRequests( $action, [ 'username' => $username ] ); $this->assertEquals( $expectedReqs, $reqs ); } @@ -53,7 +45,7 @@ class AntiSpoofPreAuthenticationProviderTest extends MediaWikiTestCase { ->disableOriginalConstructor()->getMock(); $provider->expects( $this->any() )->method( 'getSpoofUser' )->willReturn( $spoofUser ); /** @var $provider \MediaWiki\Auth\PreAuthenticationProvider */ - $provider->setManager( AuthManager::singleton() ); + $provider->setManager( MediaWikiServices::getInstance()->getAuthManager() ); $provider->setLogger( new \Psr\Log\NullLogger() ); $spoofUser->expects( $this->any() )->method( 'isLegal' )->willReturn( $isLegal ); |