From 844f529119b05c7eafccf8514ca109e1f7fb2f8d Mon Sep 17 00:00:00 2001 From: Holger Knust Date: Thu, 28 Feb 2019 15:37:40 -0500 Subject: [PATCH] Remove unused method Title::validateFileMoveOperation() This method has never been used and isn't covered by the deprecation policy since it was protected. Bug: T214316 Change-Id: I96404792e895f12abec048c62c4b70d86a3d8310 --- includes/Title.php | 22 ---------------------- tests/phpunit/includes/TitleTest.php | 2 -- 2 files changed, 24 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index 4075bd5122..064c89b10c 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3983,28 +3983,6 @@ class Title implements LinkTarget, IDBAccessObject { return $errors ?: true; } - /** - * Check if the requested move target is a valid file move target - * @todo move this to MovePage - * @param Title $nt Target title - * @return array List of errors - */ - protected function validateFileMoveOperation( $nt ) { - global $wgUser; - - $errors = []; - - $destFile = wfLocalFile( $nt ); - $destFile->load( File::READ_LATEST ); - if ( !$wgUser->isAllowed( 'reupload-shared' ) - && !$destFile->exists() && wfFindFile( $nt ) - ) { - $errors[] = [ 'file-exists-sharedrepo' ]; - } - - return $errors; - } - /** * Move a title to a new location * diff --git a/tests/phpunit/includes/TitleTest.php b/tests/phpunit/includes/TitleTest.php index 9c1d5afdbe..4af12a808c 100644 --- a/tests/phpunit/includes/TitleTest.php +++ b/tests/phpunit/includes/TitleTest.php @@ -289,7 +289,6 @@ class TitleTest extends MediaWikiTestCase { * @param array|string|bool $expected Required error * @dataProvider provideTestIsValidMoveOperation * @covers Title::isValidMoveOperation - * @covers Title::validateFileMoveOperation */ public function testIsValidMoveOperation( $source, $target, $expected ) { $this->setMwGlobals( 'wgContentHandlerUseDB', false ); @@ -315,7 +314,6 @@ class TitleTest extends MediaWikiTestCase { [ 'Test', 'Special:FooBar', 'immobile-target-namespace' ], [ 'MediaWiki:Common.js', 'Help:Some wikitext page', 'bad-target-model' ], [ 'Page', 'File:Test.jpg', 'nonfile-cannot-move-to-file' ], - // for Title::validateFileMoveOperation [ 'File:Test.jpg', 'Page', 'imagenocrossnamespace' ], ]; } -- 2.20.1