Reset the LocalClusterObjectCache service in tests

Change-Id: I0886e749dee19d729bcd4f398d65b78aa22a8065
This commit is contained in:
Aaron Schulz 2016-09-04 11:10:27 -07:00
parent 103c0831f6
commit 1cf32cf036

View file

@ -23,7 +23,12 @@ class CaptchaPreAuthenticationProviderTest extends MediaWikiTestCase {
] );
CaptchaStore::unsetInstanceForTests();
CaptchaStore::get()->clearAll();
ObjectCache::$instances[__METHOD__] = new HashBagOStuff();
$services = \MediaWiki\MediaWikiServices::getInstance();
if ( method_exists( $services, 'getLocalClusterObjectCache' ) ) {
$this->setService( 'LocalClusterObjectCache', new HashBagOStuff() );
} else {
ObjectCache::$instances[__METHOD__] = new HashBagOStuff();
}
}
public function tearDown() {