From 06d906e06e8b9d7fa5828adb4c611ec273160c44 Mon Sep 17 00:00:00 2001 From: Derick Alangi Date: Sat, 20 Apr 2019 16:24:39 +0100 Subject: [PATCH] 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 --- RELEASE-NOTES-1.34 | 1 + includes/MWNamespace.php | 13 ------------- tests/phpunit/includes/title/NamespaceInfoTest.php | 13 ------------- 3 files changed, 1 insertion(+), 26 deletions(-) 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 ) ); } -- 2.20.1