Remove unused method Title::validateFileMoveOperation()
authorHolger Knust <hknust@wikimedia.org>
Thu, 28 Feb 2019 20:37:40 +0000 (15:37 -0500)
committerLegoktm <legoktm@member.fsf.org>
Mon, 4 Mar 2019 05:14:50 +0000 (05:14 +0000)
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
tests/phpunit/includes/TitleTest.php

index 4075bd5..064c89b 100644 (file)
@@ -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
         *
index 9c1d5af..4af12a8 100644 (file)
@@ -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' ],
                ];
        }