Remove deprecated GlobalVarConfig::set()
authorKunal Mehta <legoktm@gmail.com>
Fri, 3 Oct 2014 08:32:48 +0000 (01:32 -0700)
committerLegoktm <legoktm.wikipedia@gmail.com>
Mon, 20 Oct 2014 16:43:08 +0000 (16:43 +0000)
Was deprecated in 1.24.

Change-Id: Iead2c8ba14c0524cba9585b5d4c29f2f806cfc15

includes/config/GlobalVarConfig.php
tests/phpunit/includes/config/GlobalVarConfigTest.php

index 39d6e8e..589f7d3 100644 (file)
@@ -62,15 +62,6 @@ class GlobalVarConfig implements Config {
                return $this->hasWithPrefix( $this->prefix, $name );
        }
 
-       /**
-        * @see MutableConfig::set
-        * @deprecated since 1.24
-        */
-       public function set( $name, $value ) {
-               wfDeprecated( __METHOD__, '1.24' );
-               $this->setWithPrefix( $this->prefix, $name, $value );
-       }
-
        /**
         * Get a variable with a given prefix, if not the defaults.
         *
@@ -93,16 +84,4 @@ class GlobalVarConfig implements Config {
                $var = $prefix . $name;
                return array_key_exists( $var, $GLOBALS );
        }
-
-       /**
-        * Get a variable with a given prefix, if not the defaults.
-        *
-        * @param string $prefix Prefix to use on the variable
-        * @param string $name Variable name without prefix
-        * @param mixed $value Value to set
-        * @deprecated since 1.24
-        */
-       protected function setWithPrefix( $prefix, $name, $value ) {
-               $GLOBALS[$prefix . $name] = $value;
-       }
 }
index 70b9e68..28068d5 100644 (file)
@@ -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] );
-       }
 }