mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-27 09:30:06 +00:00
Do not reset extension registry in tests
This breaks later tests, e.g.: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/450433 https://gerrit.wikimedia.org/r/c/mediawiki/core/+/465423 The only reason this didn't cause test failures until now is because the namespace data was getting (incorrectly) cached in between tests. As soon as we start resetting namespaces for each test, namespaces set by the extension registry get wiped out by these tests. Change-Id: Icb7a4a2a5d19fb1f2453b4b57a5271196b0e316d
This commit is contained in:
parent
f69013186e
commit
4228dbd2b7
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Wikimedia\ScopedCallback;
|
||||
use Wikimedia\TestingAccessWrapper;
|
||||
|
||||
/**
|
||||
* @covers SimpleCaptcha
|
||||
|
@ -67,6 +68,18 @@ class CaptchaTest extends MediaWikiTestCase {
|
|||
}
|
||||
|
||||
private function setCaptchaTriggersAttribute( $trigger, $value ) {
|
||||
// XXX This is really hacky, but is needed to stop extensions from
|
||||
// being clobbered in subsequent tests. This should be fixed properly
|
||||
// by making extension registration happen in services instead of
|
||||
// globals.
|
||||
$keys =
|
||||
TestingAccessWrapper::newFromClass( ExtensionProcessor::class )->globalSettings;
|
||||
$globalsToStash = [];
|
||||
foreach ( $keys as $key ) {
|
||||
$globalsToStash["wg$key"] = $GLOBALS["wg$key"];
|
||||
}
|
||||
$this->setMwGlobals( $globalsToStash );
|
||||
|
||||
$info = [
|
||||
'globals' => [],
|
||||
'callbacks' => [],
|
||||
|
|
Loading…
Reference in a new issue