Merge "mw.Title: Implement #makeTitle for titles with predefined namespace"
[lhc/web/wiklou.git] / includes / user / CentralIdLookup.php
index 638a3e2..4c2b5b7 100644 (file)
@@ -62,6 +62,16 @@ abstract class CentralIdLookup implements IDBAccessObject {
                return self::$instances[$providerId];
        }
 
+       /**
+        * Reset internal cache for unit testing
+        */
+       public static function resetCache() {
+               if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
+                       throw new MWException( __METHOD__ . ' may only be called from unit tests!' );
+               }
+               self::$instances = array();
+       }
+
        final public function getProviderId() {
                return $this->providerId;
        }