mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-23 15:56:50 +00:00
Merge "Fix ConfirmEdit to avoid global state"
This commit is contained in:
commit
6588e7c57e
|
@ -9,7 +9,6 @@ use MediaWiki\Extension\ConfirmEdit\Hooks;
|
|||
use MediaWiki\Extension\ConfirmEdit\SimpleCaptcha\SimpleCaptcha;
|
||||
use MediaWiki\Extension\ConfirmEdit\Store\CaptchaHashStore;
|
||||
use MediaWiki\Extension\ConfirmEdit\Store\CaptchaStore;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\Request\FauxRequest;
|
||||
use MediaWiki\Tests\Unit\Auth\AuthenticationProviderTestTrait;
|
||||
use MediaWiki\User\User;
|
||||
|
@ -29,15 +28,10 @@ class CaptchaPreAuthenticationProviderTest extends MediaWikiIntegrationTestCase
|
|||
'wgCaptchaBadLoginAttempts' => 1,
|
||||
'wgCaptchaBadLoginPerUserAttempts' => 1,
|
||||
'wgCaptchaStorageClass' => CaptchaHashStore::class,
|
||||
'wgMainCacheType' => __METHOD__,
|
||||
'wgMainCacheType' => 'hash',
|
||||
] );
|
||||
CaptchaStore::unsetInstanceForTests();
|
||||
CaptchaStore::get()->clearAll();
|
||||
$services = MediaWikiServices::getInstance();
|
||||
if ( method_exists( $services, 'getLocalClusterObjectCache' ) ) {
|
||||
$this->setService( 'LocalClusterObjectCache', new HashBagOStuff() );
|
||||
}
|
||||
ObjectCache::$instances[__METHOD__] = new HashBagOStuff();
|
||||
}
|
||||
|
||||
public function tearDown(): void {
|
||||
|
|
Loading…
Reference in a new issue