diff options
Diffstat (limited to 'tests/phpunit/includes/auth/AuthManagerTest.php')
-rw-r--r-- | tests/phpunit/includes/auth/AuthManagerTest.php | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/phpunit/includes/auth/AuthManagerTest.php b/tests/phpunit/includes/auth/AuthManagerTest.php index 09385764c3b6..3ec6f31485e0 100644 --- a/tests/phpunit/includes/auth/AuthManagerTest.php +++ b/tests/phpunit/includes/auth/AuthManagerTest.php @@ -213,13 +213,13 @@ class AuthManagerTest extends \MediaWikiIntegrationTestCase { $this->objectFactory = new ObjectFactory( $services ); } if ( $regen || !$this->readOnlyMode ) { - $this->readOnlyMode = MediaWikiServices::getInstance()->getReadOnlyMode(); + $this->readOnlyMode = $this->getServiceContainer()->getReadOnlyMode(); } if ( $regen || !$this->blockManager ) { - $this->blockManager = MediaWikiServices::getInstance()->getBlockManager(); + $this->blockManager = $this->getServiceContainer()->getBlockManager(); } if ( $regen || !$this->watchlistManager ) { - $this->watchlistManager = MediaWikiServices::getInstance()->getWatchlistManager(); + $this->watchlistManager = $this->getServiceContainer()->getWatchlistManager(); } if ( $regen || !$this->hookContainer ) { // Set up a HookContainer similar to the normal one except that it @@ -241,28 +241,28 @@ class AuthManagerTest extends \MediaWikiIntegrationTestCase { ); } if ( $regen || !$this->userNameUtils ) { - $this->userNameUtils = MediaWikiServices::getInstance()->getUserNameUtils(); + $this->userNameUtils = $this->getServiceContainer()->getUserNameUtils(); } if ( $regen || !$this->loadBalancer ) { - $this->loadBalancer = MediaWikiServices::getInstance()->getDBLoadBalancer(); + $this->loadBalancer = $this->getServiceContainer()->getDBLoadBalancer(); } if ( $regen || !$this->contentLanguage ) { - $this->contentLanguage = MediaWikiServices::getInstance()->getContentLanguage(); + $this->contentLanguage = $this->getServiceContainer()->getContentLanguage(); } if ( $regen || !$this->languageConverterFactory ) { - $this->languageConverterFactory = MediaWikiServices::getInstance()->getLanguageConverterFactory(); + $this->languageConverterFactory = $this->getServiceContainer()->getLanguageConverterFactory(); } if ( $regen || !$this->botPasswordStore ) { - $this->botPasswordStore = MediaWikiServices::getInstance()->getBotPasswordStore(); + $this->botPasswordStore = $this->getServiceContainer()->getBotPasswordStore(); } if ( $regen || !$this->userFactory ) { - $this->userFactory = MediaWikiServices::getInstance()->getUserFactory(); + $this->userFactory = $this->getServiceContainer()->getUserFactory(); } if ( $regen || !$this->userIdentityLookup ) { - $this->userIdentityLookup = MediaWikiServices::getInstance()->getUserIdentityLookup(); + $this->userIdentityLookup = $this->getServiceContainer()->getUserIdentityLookup(); } if ( $regen || !$this->userOptionsManager ) { - $this->userOptionsManager = MediaWikiServices::getInstance()->getUserOptionsManager(); + $this->userOptionsManager = $this->getServiceContainer()->getUserOptionsManager(); } if ( !$this->logger ) { $this->logger = new \TestLogger(); @@ -1815,7 +1815,7 @@ class AuthManagerTest extends \MediaWikiIntegrationTestCase { $this->assertSame( 'noname', $ret->message->getKey() ); $this->hook( 'LocalUserCreated', LocalUserCreatedHook::class, $this->never() ); - $readOnlyMode = \MediaWiki\MediaWikiServices::getInstance()->getReadOnlyMode(); + $readOnlyMode = $this->getServiceContainer()->getReadOnlyMode(); $readOnlyMode->setReason( 'Because' ); $userReq->username = self::usernameForCreation(); $ret = $this->manager->beginAccountCreation( $creator, [ $userReq ], 'http://localhost/' ); @@ -1988,7 +1988,7 @@ class AuthManagerTest extends \MediaWikiIntegrationTestCase { $this->hook( 'LocalUserCreated', LocalUserCreatedHook::class, $this->never() ); $this->request->getSession()->setSecret( 'AuthManager::accountCreationState', [ 'username' => $creator->getName() ] + $session ); - $readOnlyMode = \MediaWiki\MediaWikiServices::getInstance()->getReadOnlyMode(); + $readOnlyMode = $this->getServiceContainer()->getReadOnlyMode(); $readOnlyMode->setReason( 'Because' ); $ret = $this->manager->continueAccountCreation( [] ); $this->unhook( 'LocalUserCreated' ); @@ -2687,7 +2687,7 @@ class AuthManagerTest extends \MediaWikiIntegrationTestCase { // Wiki is read-only $session->clear(); $this->hook( 'LocalUserCreated', LocalUserCreatedHook::class, $this->never() ); - $readOnlyMode = \MediaWiki\MediaWikiServices::getInstance()->getReadOnlyMode(); + $readOnlyMode = $this->getServiceContainer()->getReadOnlyMode(); $readOnlyMode->setReason( 'Because' ); $user = \User::newFromName( $username ); $ret = $this->manager->autoCreateUser( $user, AuthManager::AUTOCREATE_SOURCE_SESSION, true, true ); |