public static function setUpBeforeClass() { parent::setUpBeforeClass(); // Get the service locator, and reset services if it's not done already self::$serviceLocator = self::prepareServices(new GlobalVarConfig()); }
/** * Reset global services, and install testing environment. * This is the testing equivalent of MediaWikiServices::resetGlobalInstance(). * This should only be used to set up the testing environment, not when * running unit tests. Use overrideMwServices() for that. * * @see MediaWikiServices::resetGlobalInstance() * @see prepareServices() * @see overrideMwServices() * * @param Config|null $bootstrapConfig The bootstrap config to use with the new * MediaWikiServices. */ protected static function resetGlobalServices(Config $bootstrapConfig = null) { $oldServices = MediaWikiServices::getInstance(); $oldConfigFactory = $oldServices->getConfigFactory(); $testConfig = self::makeTestConfig($bootstrapConfig); MediaWikiServices::resetGlobalInstance($testConfig); self::$serviceLocator = MediaWikiServices::getInstance(); self::installTestServices($oldConfigFactory, self::$serviceLocator); }