/** * @covers ConfigFactory::register */ public function testRegisterInstance() { $config = GlobalVarConfig::newInstance(); $factory = new ConfigFactory(); $factory->register('unittest', $config); $this->assertSame($config, $factory->makeConfig('unittest')); }
/** * @covers GlobalVarConfig::newInstance */ public function testNewInstance() { $config = GlobalVarConfig::newInstance(); $this->assertInstanceOf('GlobalVarConfig', $config); $this->maybeStashGlobal('wgBaz'); $GLOBALS['wgBaz'] = 'somevalue'; // Check prefix is set to 'wg' $this->assertEquals('somevalue', $config->get('Baz')); }
public function getConfig($name) { if ($this->config === null) { $this->config = GlobalVarConfig::newInstance(); } if ($this->config->has($name)) { return $this->config->get($name); } return null; }