Merge "Avoid theoretical division by zero"
[lhc/web/wiklou.git] / tests / phpunit / includes / config / GlobalVarConfigTest.php
1 <?php
2
3 class GlobalVarConfigTest extends MediaWikiTestCase {
4
5 public function provideGet() {
6 $set = array(
7 'wgSomething' => 'default1',
8 'wgFoo' => 'default2',
9 'efVariable' => 'default3',
10 'BAR' => 'default4',
11 );
12
13 foreach ( $set as $var => $value ) {
14 $GLOBALS[$var] = $value;
15 }
16
17 return array(
18 array( 'Something', 'wg', 'default1' ),
19 array( 'Foo', 'wg', 'default2' ),
20 array( 'Variable', 'ef', 'default3' ),
21 array( 'BAR', '', 'default4' ),
22 );
23 }
24
25 /**
26 * @param string $name
27 * @param string $prefix
28 * @param string $expected
29 * @dataProvider provideGet
30 * @covers GlobalVarConfig::get
31 */
32 public function testGet( $name, $prefix, $expected ) {
33 $config = new GlobalVarConfig( $prefix );
34 $this->assertEquals( $config->get( $name ), $expected );
35 }
36 }