3 class GlobalConfigTest
extends MediaWikiTestCase
{
5 /** @var GlobalConfig $config */
8 protected function setUp() {
10 $this->config
= new GlobalConfig
;
13 public static function provideGet() {
15 array( 'wgSitename', array( 'Sitename' ) ),
16 array( 'wgFoo', array( 'Foo' ) ),
17 array( 'efVariable', array( 'Variable', 'ef' ) ),
18 array( 'Foo', array( 'Foo', '' ) ),
24 * @param array $params
25 * @dataProvider provideGet
26 * @covers GlobalConfig::get
28 public function testGet( $name, $params ) {
30 $old = isset( $GLOBALS[$name] ) ?
$GLOBALS[$name] : null;
31 $GLOBALS[$name] = $rand;
32 $out = call_user_func_array( array( $this->config
, 'get' ), $params );
33 $this->assertEquals( $rand, $out );
35 $GLOBALS[$name] = $old;