Merge "Make NumericUppercaseCollation use localized digit transforms"
[lhc/web/wiklou.git] / tests / phpunit / includes / config / GlobalVarConfigTest.php
index 2750196..c76e8bb 100644 (file)
@@ -29,13 +29,13 @@ class GlobalVarConfigTest extends MediaWikiTestCase {
        }
 
        public static function provideConstructor() {
-               return array(
-                       array( 'wg' ),
-                       array( 'ef' ),
-                       array( 'smw' ),
-                       array( 'blahblahblahblah' ),
-                       array( '' ),
-               );
+               return [
+                       [ 'wg' ],
+                       [ 'ef' ],
+                       [ 'smw' ],
+                       [ 'blahblahblahblah' ],
+                       [ '' ],
+               ];
        }
 
        /**
@@ -50,25 +50,25 @@ class GlobalVarConfigTest extends MediaWikiTestCase {
                $this->assertFalse( $config->has( 'GlobalVarConfigTestNotHas' ) );
        }
 
-       public function provideGet() {
-               $set = array(
+       public static function provideGet() {
+               $set = [
                        'wgSomething' => 'default1',
                        'wgFoo' => 'default2',
                        'efVariable' => 'default3',
                        'BAR' => 'default4',
-               );
+               ];
 
                foreach ( $set as $var => $value ) {
                        $GLOBALS[$var] = $value;
                }
 
-               return array(
-                       array( 'Something', 'wg', 'default1' ),
-                       array( 'Foo', 'wg', 'default2' ),
-                       array( 'Variable', 'ef', 'default3' ),
-                       array( 'BAR', '', 'default4' ),
-                       array( 'ThisGlobalWasNotSetAbove', 'wg', false )
-               );
+               return [
+                       [ 'Something', 'wg', 'default1' ],
+                       [ 'Foo', 'wg', 'default2' ],
+                       [ 'Variable', 'ef', 'default3' ],
+                       [ 'BAR', '', 'default4' ],
+                       [ 'ThisGlobalWasNotSetAbove', 'wg', false ]
+               ];
        }
 
        /**
@@ -87,34 +87,10 @@ class GlobalVarConfigTest extends MediaWikiTestCase {
                $this->assertEquals( $config->get( $name ), $expected );
        }
 
-       public static function provideSet() {
-               return array(
-                       array( 'Foo', 'wg', 'wgFoo' ),
-                       array( 'SomethingRandom', 'wg', 'wgSomethingRandom' ),
-                       array( 'FromAnExtension', 'eg', 'egFromAnExtension' ),
-                       array( 'NoPrefixHere', '', 'NoPrefixHere' ),
-               );
-       }
-
        private function maybeStashGlobal( $var ) {
                if ( array_key_exists( $var, $GLOBALS ) ) {
                        // Will be reset after this test is over
                        $this->stashMwGlobals( $var );
                }
        }
-
-       /**
-        * @dataProvider provideSet
-        * @covers GlobalVarConfig::set
-        * @covers GlobalVarConfig::setWithPrefix
-        */
-       public function testSet( $name, $prefix, $var ) {
-               $this->hideDeprecated( 'GlobalVarConfig::set' );
-               $this->maybeStashGlobal( $var );
-               $config = new GlobalVarConfig( $prefix );
-               $random = wfRandomString();
-               $config->set( $name, $random );
-               $this->assertArrayHasKey( $var, $GLOBALS );
-               $this->assertEquals( $random, $GLOBALS[$var] );
-       }
 }