Remove messages.inc, rebuildLanguage.php, writeMessagesArray.inc
[mediawiki.git] / tests / phpunit / includes / config / GlobalConfigTest.php
blobb605a46eb2442bd095580dddd4099d5c25e2235f
1 <?php
3 class GlobalConfigTest extends MediaWikiTestCase {
5 /** @var GlobalConfig $config */
6 protected $config;
8 protected function setUp() {
9 parent::setUp();
10 $this->config = new GlobalConfig;
13 public static function provideGet() {
14 return array(
15 array( 'wgSitename', array( 'Sitename' ) ),
16 array( 'wgFoo', array( 'Foo' ) ),
17 array( 'efVariable', array( 'Variable', 'ef' ) ),
18 array( 'Foo', array( 'Foo', '' ) ),
22 /**
23 * @param string $name
24 * @param array $params
25 * @dataProvider provideGet
26 * @covers GlobalConfig::get
28 public function testGet( $name, $params ) {
29 $rand = wfRandom();
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 );
34 if ( $old ) {
35 $GLOBALS[$name] = $old;