<?php
+use MediaWiki\MediaWikiServices;
+
class ConfigFactoryTest extends MediaWikiTestCase {
/**
// define new config instance
$newFactory = new ConfigFactory();
$newFactory->register( 'foo', 'GlobalVarConfig::newInstance' );
- $newFactory->register( 'bar', function() {
+ $newFactory->register( 'bar', function () {
return new HashConfig();
} );
public function testGetDefaultInstance() {
// NOTE: the global config factory returned here has been overwritten
// for operation in test mode. It may not reflect LocalSettings.
- $factory = ConfigFactory::getDefaultInstance();
+ $factory = MediaWikiServices::getInstance()->getConfigFactory();
$this->assertInstanceOf( 'Config', $factory->makeConfig( 'main' ) );
}