Merge "RCFilters: make isStructuredFilterUiEnabled public"
[lhc/web/wiklou.git] / includes / user / CentralIdLookup.php
index 616ae93..2ced6e2 100644 (file)
@@ -19,7 +19,6 @@
  *
  * @file
  */
-use MediaWiki\MediaWikiServices;
 
 /**
  * The CentralIdLookup service allows for connecting local users with
@@ -32,7 +31,7 @@ abstract class CentralIdLookup implements IDBAccessObject {
        const AUDIENCE_PUBLIC = 1;
        const AUDIENCE_RAW = 2;
 
-       /** @var CentralIdLookup[][] */
+       /** @var CentralIdLookup[] */
        private static $instances = [];
 
        /** @var string */
@@ -69,8 +68,9 @@ abstract class CentralIdLookup implements IDBAccessObject {
         * Reset internal cache for unit testing
         */
        public static function resetCache() {
-               // TODO: manage service instances in MediaWikiServices
-               MediaWikiServices::failUnlessBootstrapping( __METHOD__ );
+               if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
+                       throw new MWException( __METHOD__ . ' may only be called from unit tests!' );
+               }
                self::$instances = [];
        }