);
}
- public function provideGet() {
+ /**
+ * @covers GlobalVarConfig::has
+ */
+ public function testHas() {
+ $this->maybeStashGlobal( 'wgGlobalVarConfigTestHas' );
+ $GLOBALS['wgGlobalVarConfigTestHas'] = wfRandomString();
+ $this->maybeStashGlobal( 'wgGlobalVarConfigTestNotHas' );
+ $config = new GlobalVarConfig();
+ $this->assertTrue( $config->has( 'GlobalVarConfigTestHas' ) );
+ $this->assertFalse( $config->has( 'GlobalVarConfigTestNotHas' ) );
+ }
+
+ public static function provideGet() {
$set = array(
'wgSomething' => 'default1',
'wgFoo' => 'default2',
public function testGet( $name, $prefix, $expected ) {
$config = new GlobalVarConfig( $prefix );
if ( $expected === false ) {
- $this->setExpectedException( 'ConfigException', 'GlobalVarConfig::getWithPrefix: undefined variable:' );
+ $this->setExpectedException( 'ConfigException', 'GlobalVarConfig::get: undefined option:' );
}
$this->assertEquals( $config->get( $name ), $expected );
}
* @covers GlobalVarConfig::setWithPrefix
*/
public function testSet( $name, $prefix, $var ) {
+ $this->hideDeprecated( 'GlobalVarConfig::set' );
$this->maybeStashGlobal( $var );
$config = new GlobalVarConfig( $prefix );
$random = wfRandomString();