Legoktm has uploaded a new change for review.
https://gerrit.wikimedia.org/r/164522
Change subject: Remove deprecated GlobalVarConfig::set()
......................................................................
Remove deprecated GlobalVarConfig::set()
Was deprecated in 1.24.
Change-Id: Iead2c8ba14c0524cba9585b5d4c29f2f806cfc15
---
M includes/config/GlobalVarConfig.php
M tests/phpunit/includes/config/GlobalVarConfigTest.php
2 files changed, 0 insertions(+), 45 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/22/164522/1
diff --git a/includes/config/GlobalVarConfig.php
b/includes/config/GlobalVarConfig.php
index 39d6e8e..589f7d3 100644
--- a/includes/config/GlobalVarConfig.php
+++ b/includes/config/GlobalVarConfig.php
@@ -63,15 +63,6 @@
}
/**
- * @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.
*
* @param string $prefix Prefix to use on the variable, if one.
@@ -92,17 +83,5 @@
protected function hasWithPrefix( $prefix, $name ) {
$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 70b9e68..28068d5 100644
--- a/tests/phpunit/includes/config/GlobalVarConfigTest.php
+++ b/tests/phpunit/includes/config/GlobalVarConfigTest.php
@@ -87,34 +87,10 @@
$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] );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/164522
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iead2c8ba14c0524cba9585b5d4c29f2f806cfc15
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits