From: Derick Alangi Date: Sat, 20 Apr 2019 15:24:39 +0000 (+0100) Subject: MWNamespace: Remove deprecated method ::canTalk() and test suit X-Git-Tag: 1.34.0-rc.0~1911 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/One?a=commitdiff_plain;h=06d906e06e8b9d7fa5828adb4c611ec273160c44;p=lhc%2Fweb%2Fwiklou.git MWNamespace: Remove deprecated method ::canTalk() and test suit This method was deprecated in .30 hence remove as the usage is actually zero in extensions and one only in core. Usage: https://codesearch.wmflabs.org/search/?q=%3A%3AcanTalk%5C(&i=nope&files=&repos= Change-Id: Ia18c63f95c969d13c28ffb1afa376ec2df2002a3 --- diff --git a/RELEASE-NOTES-1.34 b/RELEASE-NOTES-1.34 index c85d67850d..199b82c8ea 100644 --- a/RELEASE-NOTES-1.34 +++ b/RELEASE-NOTES-1.34 @@ -102,6 +102,7 @@ because of Phabricator reports. SearchEngine::getNearMatch(), methods deprecated in 1.27, have been removed. * FileRepo::streamFile(), deprecated in 1.26, has been removed. * User::randomPassword() method, deprecated in 1.27, have been removed. +* MWNamespace::canTalk(), deprecated in 1.30, have been removed. === Deprecations in 1.34 === * The MWNamespace class is deprecated. Use MediaWikiServices::getNamespaceInfo. diff --git a/includes/MWNamespace.php b/includes/MWNamespace.php index 1529473a92..0121bd589c 100644 --- a/includes/MWNamespace.php +++ b/includes/MWNamespace.php @@ -176,19 +176,6 @@ class MWNamespace { return MediaWikiServices::getInstance()->getNamespaceInfo()->getValidNamespaces(); } - /** - * Does this namespace ever have a talk namespace? - * - * @deprecated since 1.30, use hasTalkNamespace() instead. - * - * @param int $index Namespace index - * @return bool True if this namespace either is or has a corresponding talk namespace. - */ - public static function canTalk( $index ) { - wfDeprecated( __METHOD__, '1.30' ); - return self::hasTalkNamespace( $index ); - } - /** * Does this namespace ever have a talk namespace? * diff --git a/tests/phpunit/includes/title/NamespaceInfoTest.php b/tests/phpunit/includes/title/NamespaceInfoTest.php index cc7df8d31f..21b64682d4 100644 --- a/tests/phpunit/includes/title/NamespaceInfoTest.php +++ b/tests/phpunit/includes/title/NamespaceInfoTest.php @@ -246,19 +246,6 @@ class NamespaceInfoTest extends MediaWikiTestCase { $this->assertSame( $actual, $expected, "NS $index" ); } - /** - * @dataProvider provideHasTalkNamespace - * @covers MWNamespace::canTalk - * - * @param int $index - * @param bool $expected - */ - public function testCanTalk( $index, $expected ) { - $this->hideDeprecated( 'MWNamespace::canTalk' ); - $actual = MWNamespace::canTalk( $index ); - $this->assertSame( $actual, $expected, "NS $index" ); - } - private function assertIsContent( $ns ) { $this->assertTrue( $this->obj->isContent( $ns ) ); }