Merge "Use PHPUnit 4/6 compat in VersionCheckerTest"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 12 Apr 2018 18:01:59 +0000 (18:01 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 12 Apr 2018 18:01:59 +0000 (18:01 +0000)
RELEASE-NOTES-1.31
includes/user/User.php
maintenance/Maintenance.php
tests/phpunit/includes/api/ApiMainTest.php

index f40a422..ea3aa8b 100644 (file)
@@ -331,6 +331,8 @@ changes to languages because of Phabricator reports.
 * The type string for the parameter $lang of DateFormatter::getInstance is
   deprecated.
 * Wikimedia\Rdbms\SavepointPostgres is deprecated.
+* The DO_MAINTENANCE constant is deprecated. RUN_MAINTENANCE_IF_MAIN should be
+  used instead.
 
 === Other changes in 1.31 ===
 * Browser support for Internet Explorer 10 was lowered from Grade A to Grade C.
index 3e6b212..ea395f4 100644 (file)
@@ -3084,7 +3084,7 @@ class User implements IDBAccessObject, UserIdentity {
         * Get the user's current setting for a given option.
         *
         * @param string $oname The option to check
-        * @param string $defaultOverride A default value returned if the option does not exist
+        * @param string|array $defaultOverride A default value returned if the option does not exist
         * @param bool $ignoreHidden Whether to ignore the effects of $wgHiddenPrefs
         * @return string|array|int|null User's current value for the option
         * @see getBoolOption()
index 9685177..cb95fa7 100644 (file)
@@ -35,6 +35,10 @@ use Wikimedia\Rdbms\DBReplicationWaitError;
 
 // Define this so scripts can easily find doMaintenance.php
 define( 'RUN_MAINTENANCE_IF_MAIN', __DIR__ . '/doMaintenance.php' );
+
+/**
+ * @deprecated since 1.31
+ */
 define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN ); // original name, harmless
 
 $maintClass = false;
index 8ffe4fc..d17334b 100644 (file)
@@ -46,7 +46,7 @@ class ApiMainTest extends ApiTestCase {
         */
        private function getNonInternalApiMain( array $requestData, array $headers = [] ) {
                $req = $this->getMockBuilder( WebRequest::class )
-                       ->setMethods( [ 'response', 'getIP' ] )
+                       ->setMethods( [ 'response', 'getRawIP' ] )
                        ->getMock();
                $response = new FauxResponse();
                $req->method( 'response' )->willReturn( $response );