+ $this->maybeStashGlobal( 'wgBaz' );
+ $GLOBALS['wgBaz'] = 'somevalue';
+ // Check prefix is set to 'wg'
+ $this->assertEquals( 'somevalue', $config->get( 'Baz' ) );
+ }
+
+ /**
+ * @covers GlobalVarConfig::__construct
+ * @dataProvider provideConstructor
+ */
+ public function testConstructor( $prefix ) {
+ $var = $prefix . 'GlobalVarConfigTest';
+ $rand = wfRandomString();
+ $this->maybeStashGlobal( $var );
+ $GLOBALS[$var] = $rand;
+ $config = new GlobalVarConfig( $prefix );
+ $this->assertInstanceOf( 'GlobalVarConfig', $config );
+ $this->assertEquals( $rand, $config->get( 'GlobalVarConfigTest' ) );
+ }
+
+ public static function provideConstructor() {
+ return array(
+ array( 'wg' ),
+ array( 'ef' ),
+ array( 'smw' ),
+ array( 'blahblahblahblah' ),
+ array( '' ),
+ );