From 876ae95e632ecd0c8fb3ca0dcb6d8ad0c3c276ff Mon Sep 17 00:00:00 2001 From: Florian Date: Sat, 2 Apr 2016 10:18:20 +0200 Subject: [PATCH] Remove Title::newFromRedirectArray Bug: T122754 Change-Id: I2cdeb98c81d4b98ea986bd2f7b23cd93c62c5930 --- RELEASE-NOTES-1.27 | 1 + includes/Title.php | 17 ----------------- .../includes/content/JavaScriptContentTest.php | 10 ---------- .../includes/content/TextContentTest.php | 10 ---------- 4 files changed, 1 insertion(+), 37 deletions(-) diff --git a/RELEASE-NOTES-1.27 b/RELEASE-NOTES-1.27 index b0d45b8303..b6161da624 100644 --- a/RELEASE-NOTES-1.27 +++ b/RELEASE-NOTES-1.27 @@ -400,6 +400,7 @@ changes to languages because of Phabricator reports. * Article::getUndoText() and WikiPage::getUndoText were removed (deprecated since 1.21). * DifferenceEngine::setText() was removed (deprecated in 1.21). +* Title::newFromRedirectArray() was removed (deprecated in 1.21). == Compatibility == diff --git a/includes/Title.php b/includes/Title.php index ec17ef5565..a6163f0963 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -589,23 +589,6 @@ class Title implements LinkTarget { return $content->getUltimateRedirectTarget(); } - /** - * Extract a redirect destination from a string and return an - * array of Titles, or null if the text doesn't contain a valid redirect - * The last element in the array is the final destination after all redirects - * have been resolved (up to $wgMaxRedirects times) - * - * @param string $text Text with possible redirect - * @return Title[] Array of Titles, with the destination last - * @deprecated since 1.21, use Content::getRedirectChain instead. - */ - public static function newFromRedirectArray( $text ) { - ContentHandler::deprecated( __METHOD__, '1.21' ); - - $content = ContentHandler::makeContent( $text, null, CONTENT_MODEL_WIKITEXT ); - return $content->getRedirectChain(); - } - /** * Get the prefixed DB key associated with an ID * diff --git a/tests/phpunit/includes/content/JavaScriptContentTest.php b/tests/phpunit/includes/content/JavaScriptContentTest.php index 8cbbfb8a78..97e0b1c0ec 100644 --- a/tests/phpunit/includes/content/JavaScriptContentTest.php +++ b/tests/phpunit/includes/content/JavaScriptContentTest.php @@ -141,16 +141,6 @@ class JavaScriptContentTest extends TextContentTest { ]; } - /** - * @todo Test needs database! - */ - /* - public function getRedirectChain() { - $text = $this->getNativeData(); - return Title::newFromRedirectArray( $text ); - } - */ - /** * @todo Test needs database! */ diff --git a/tests/phpunit/includes/content/TextContentTest.php b/tests/phpunit/includes/content/TextContentTest.php index 93bf716292..d89f3eb26a 100644 --- a/tests/phpunit/includes/content/TextContentTest.php +++ b/tests/phpunit/includes/content/TextContentTest.php @@ -180,16 +180,6 @@ class TextContentTest extends MediaWikiLangTestCase { $this->assertEquals( !is_null( $expected ), $content->isRedirect() ); } - /** - * @todo Test needs database! Should be done by a test class in the Database group. - */ - /* - public function getRedirectChain() { - $text = $this->getNativeData(); - return Title::newFromRedirectArray( $text ); - } - */ - /** * @todo Test needs database! Should be done by a test class in the Database group. */ -- 2.20.1