From ebefa2fc50e1794014b9357b0ce5d18d1a1b7584 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Fri, 3 Oct 2014 01:32:48 -0700 Subject: [PATCH] Remove deprecated GlobalVarConfig::set() Was deprecated in 1.24. Change-Id: Iead2c8ba14c0524cba9585b5d4c29f2f806cfc15 --- includes/config/GlobalVarConfig.php | 21 ---------------- .../includes/config/GlobalVarConfigTest.php | 24 ------------------- 2 files changed, 45 deletions(-) diff --git a/includes/config/GlobalVarConfig.php b/includes/config/GlobalVarConfig.php index 39d6e8e1db..589f7d3548 100644 --- a/includes/config/GlobalVarConfig.php +++ b/includes/config/GlobalVarConfig.php @@ -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; - } } diff --git a/tests/phpunit/includes/config/GlobalVarConfigTest.php b/tests/phpunit/includes/config/GlobalVarConfigTest.php index 70b9e6845c..28068d5e27 100644 --- a/tests/phpunit/includes/config/GlobalVarConfigTest.php +++ b/tests/phpunit/includes/config/GlobalVarConfigTest.php @@ -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] ); - } } -- 2.20.1