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
This commit is contained in:
Derick Alangi 2019-04-20 16:24:39 +01:00
parent 6b89deff20
commit 06d906e06e
3 changed files with 1 additions and 26 deletions

View file

@ -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.

View file

@ -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?
*

View file

@ -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 ) );
}