Merge "API: No mustposttoken error with $wgDebugAPI"
[lhc/web/wiklou.git] / tests / phpunit / includes / config / GlobalVarConfigTest.php
index b15ffa7..70b9e68 100644 (file)
@@ -38,7 +38,19 @@ class GlobalVarConfigTest extends MediaWikiTestCase {
                );
        }
 
-       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',
@@ -70,7 +82,7 @@ class GlobalVarConfigTest extends MediaWikiTestCase {
        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 );
        }