Merge "mediawiki.util: Document isIPAddress() allowBlock as optional"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 19 Mar 2018 06:45:19 +0000 (06:45 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 19 Mar 2018 06:45:19 +0000 (06:45 +0000)
includes/filerepo/file/LocalFile.php
includes/libs/HashRing.php
tests/phpunit/includes/changes/ChangesListStringOptionsFilterGroupTest.php
tests/phpunit/includes/libs/GenericArrayObjectTest.php
tests/phpunit/includes/page/WikiPageDbTestBase.php

index ec4a5fb..7fc45eb 100644 (file)
@@ -3374,6 +3374,8 @@ class LocalFileMoveBatch {
         * many rows where updated.
         */
        protected function doDBUpdates() {
+               global $wgCommentTableSchemaMigrationStage;
+
                $dbw = $this->db;
 
                // Update current image
@@ -3383,6 +3385,15 @@ class LocalFileMoveBatch {
                        [ 'img_name' => $this->oldName ],
                        __METHOD__
                );
+               if ( $wgCommentTableSchemaMigrationStage > MIGRATION_OLD ) {
+                       $dbw->update(
+                               'image_comment_temp',
+                               [ 'imgcomment_name' => $this->newName ],
+                               [ 'imgcomment_name' => $this->oldName ],
+                               __METHOD__
+                       );
+               }
+
                // Update old images
                $dbw->update(
                        'oldimage',
index 6612130..3b9c24d 100644 (file)
@@ -136,19 +136,6 @@ class HashRing {
                return $this->sourceMap;
        }
 
-       /**
-        * Get a new hash ring with a location removed from the ring
-        *
-        * @param string $location
-        * @return HashRing|bool Returns false if no non-zero weighted spots are left
-        */
-       public function newWithoutLocation( $location ) {
-               $map = $this->sourceMap;
-               unset( $map[$location] );
-
-               return count( $map ) ? new self( $map ) : false;
-       }
-
        /**
         * Remove a location from the "live" hash ring
         *
index 2355f76..b627178 100644 (file)
@@ -179,8 +179,6 @@ class ChangesListStringOptionsFilterGroupTest extends MediaWikiTestCase {
        /**
         * @param array $groupDefinition Group definition
         * @param string $input Value in URL
-        *
-        * @dataProvider provideModifyQuery
         */
        protected function modifyQueryHelper( $groupDefinition, $input ) {
                $ctx = $this->createMock( IContextSource::class );
index a7cf755..3be2b06 100644 (file)
@@ -173,8 +173,6 @@ abstract class GenericArrayObjectTest extends PHPUnit\Framework\TestCase {
         * @since 1.20
         *
         * @param callable $function
-        *
-        * @covers GenericArrayObject::getObjectType
         */
        protected function checkTypeChecks( $function ) {
                $excption = null;
@@ -206,7 +204,7 @@ abstract class GenericArrayObjectTest extends PHPUnit\Framework\TestCase {
         * @since 1.20
         *
         * @param array $elements
-        *
+        * @covers GenericArrayObject::getObjectType
         * @covers GenericArrayObject::offsetSet
         */
        public function testOffsetSet( array $elements ) {
index 6367a0f..53b659f 100644 (file)
@@ -1390,7 +1390,7 @@ more stuff
         * @covers WikiPage::newFromID
         */
        public function testNewFromId_returnsNullOnNonExistingId() {
-               $this->assertNull( WikiPage::newFromID( 73574757437437743743 ) );
+               $this->assertNull( WikiPage::newFromID( 2147483647 ) );
        }
 
        public function provideTestInsertProtectNullRevision() {