Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F585286
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/tests/common/TestSetup.php b/tests/common/TestSetup.php
index 9258a3cda12..7d3194bd28b 100644
--- a/tests/common/TestSetup.php
+++ b/tests/common/TestSetup.php
@@ -5,6 +5,8 @@ use MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider;
use MediaWiki\JobQueue\JobQueueMemory;
use MediaWiki\Logger\LegacySpi;
use MediaWiki\Maintenance\MaintenanceFatalError;
+use MediaWiki\MediaWikiServices;
+use MediaWiki\Registration\ExtensionRegistry;
use MediaWiki\Session\CookieSessionProvider;
/**
@@ -201,7 +203,8 @@ class TestSetup {
}
// Setup.php creates this variable, but we cannot wait for the below code to make it global,
- // because Setup.php needs this to be a global during its execution (not just after).
+ // because Setup.php (and MW_SETUP_CALLBACK -> TestsAutoLoader.php) needs this to be a
+ // global during its execution (not just after).
// phpcs:ignore MediaWiki.VariableAnalysis.UnusedGlobalVariables
global $wgAutoloadClasses;
@@ -235,8 +238,6 @@ class TestSetup {
public static function loadSettingsFiles(): void {
// phpcs:ignore MediaWiki.Usage.ForbiddenFunctions.define
define( 'MW_SETUP_CALLBACK', [ self::class, 'setupCallback' ] );
- define( 'MW_AUTOLOAD_TEST_CLASSES', true );
- define( 'MW_FINAL_SETUP_CALLBACK', [ self::class, 'applyInitialConfig' ] );
self::requireOnceInGlobalScope( MW_INSTALL_PATH . "/includes/Setup.php" );
}
@@ -268,6 +269,16 @@ class TestSetup {
$wgLBFactoryConf['serverTemplate']['user'] = $wgDBuser;
$wgLBFactoryConf['serverTemplate']['password'] = $wgDBpassword;
}
+ $service = MediaWikiServices::getInstance()->peekService( 'DBLoadBalancerFactory' );
+ if ( $service ) {
+ $service->destroy();
+ }
}
+
+ self::requireOnceInGlobalScope( __DIR__ . '/TestsAutoLoader.php' );
+
+ self::applyInitialConfig();
+
+ ExtensionRegistry::getInstance()->setLoadTestClassesAndNamespaces( true );
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Jul 5, 5:32 AM (18 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
227694
Default Alt Text
(1 KB)
Attached To
Mode
rMW mediawiki
Attached
Detach File
Event Timeline
Log In to Comment