diff --git a/includes/auth/AuthManager.php b/includes/auth/AuthManager.php index 50b531e3535..5ab2b00ba93 100644 --- a/includes/auth/AuthManager.php +++ b/includes/auth/AuthManager.php @@ -133,9 +133,6 @@ class AuthManager implements LoggerAwareInterface { /** Auto-creation is due to a Maintenance script */ public const AUTOCREATE_SOURCE_MAINT = '::Maintenance::'; - /** @var AuthManager|null */ - private static $instance = null; - /** @var WebRequest */ private $request; @@ -2472,21 +2469,6 @@ class AuthManager implements LoggerAwareInterface { } } - /** - * Reset the internal caching for unit testing - * @note Unit tests only - * @internal - */ - public static function resetCache() { - if ( !defined( 'MW_PHPUNIT_TEST' ) ) { - // @codeCoverageIgnoreStart - throw new \MWException( __METHOD__ . ' may only be called from unit tests!' ); - // @codeCoverageIgnoreEnd - } - - self::$instance = null; - } - /** * @return HookContainer */ diff --git a/tests/phpunit/MediaWikiIntegrationTestCase.php b/tests/phpunit/MediaWikiIntegrationTestCase.php index 180c6d5babd..4572b40e55a 100644 --- a/tests/phpunit/MediaWikiIntegrationTestCase.php +++ b/tests/phpunit/MediaWikiIntegrationTestCase.php @@ -645,7 +645,6 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase { } $wgRequest = RequestContext::getMain()->getRequest(); MediaWiki\Session\SessionManager::resetCache(); - MediaWiki\Auth\AuthManager::resetCache(); // If anything changed the content language, we need to // reset the SpecialPageFactory. diff --git a/tests/phpunit/includes/api/ApiTestCase.php b/tests/phpunit/includes/api/ApiTestCase.php index cad7aae7c28..d90d6f1886c 100644 --- a/tests/phpunit/includes/api/ApiTestCase.php +++ b/tests/phpunit/includes/api/ApiTestCase.php @@ -110,7 +110,6 @@ abstract class ApiTestCase extends MediaWikiLangTestCase { $wgRequest = $this->buildFauxRequest( $params, $sessionObj ); RequestContext::getMain()->setRequest( $wgRequest ); RequestContext::getMain()->setAuthority( $performer ); - MediaWiki\Auth\AuthManager::resetCache(); // set up local environment $context = $this->apiContext->newTestContext( $wgRequest, $performer );