Merge "Revert "rdbms: codify DatabaseDomain table "_" prefix convention""
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 3 Jul 2019 15:57:29 +0000 (15:57 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 3 Jul 2019 15:57:29 +0000 (15:57 +0000)
.phpcs.xml
includes/ActorMigration.php
includes/CommentStore.php
includes/api/ApiBase.php
includes/api/ApiMessageTrait.php
tests/phpunit/MediaWikiIntegrationTestCase.php

index 76234a2..8f3bd8c 100644 (file)
@@ -60,6 +60,7 @@
                <exclude-pattern>maintenance/doMaintenance\.php</exclude-pattern>
                <exclude-pattern>maintenance/mergeMessageFileList\.php</exclude-pattern>
                <exclude-pattern>maintenance/commandLine\.inc</exclude-pattern>
+               <exclude-pattern>tests/phpunit/MediaWikiIntegrationTestCase\.php</exclude-pattern>
        </rule>
        <rule ref="Generic.Files.LineLength">
                <exclude-pattern>*/languages/messages/Messages*\.php</exclude-pattern>
index 597b8e7..5dde8a0 100644 (file)
@@ -144,11 +144,12 @@ class ActorMigration {
         *
         * @param string $key A key such as "rev_user" identifying the actor
         *  field being fetched.
-        * @return array With three keys:
+        * @return array[] With three keys:
         *   - tables: (string[]) to include in the `$table` to `IDatabase->select()`
         *   - fields: (string[]) to include in the `$vars` to `IDatabase->select()`
         *   - joins: (array) to include in the `$join_conds` to `IDatabase->select()`
         *  All tables, fields, and joins are aliased, so `+` is safe to use.
+        * @phan-return array{tables:string[],fields:string[],joins:array}
         */
        public function getJoin( $key ) {
                if ( !isset( $this->joinCache[$key] ) ) {
index 4a673c4..994a064 100644 (file)
@@ -197,7 +197,7 @@ class CommentStore {
         * @since 1.31 Method signature changed, $key parameter added (with deprecated back compat)
         * @param string|null $key A key such as "rev_comment" identifying the comment
         *  field being fetched.
-        * @return array With three keys:
+        * @return array[] With three keys:
         *   - tables: (string[]) to include in the `$table` to `IDatabase->select()`
         *   - fields: (string[]) to include in the `$vars` to `IDatabase->select()`
         *   - joins: (array) to include in the `$join_conds` to `IDatabase->select()`
index e798414..63d8b18 100644 (file)
@@ -280,9 +280,10 @@ abstract class ApiBase extends ContextSource {
        /** $var array Map of web UI block messages to corresponding API messages and codes */
        private static $blockMsgMap = [
                'blockedtext' => [ 'apierror-blocked', 'blocked' ],
-               'blockedtext-partial' => [ 'apierror-blocked', 'blocked' ],
+               'blockedtext-partial' => [ 'apierror-blocked-partial', 'blocked' ],
                'autoblockedtext' => [ 'apierror-autoblocked', 'autoblocked' ],
                'systemblockedtext' => [ 'apierror-systemblocked', 'blocked' ],
+               'blockedtext-composite' => [ 'apierror-blocked', 'blocked' ],
        ];
 
        /** @var ApiMain */
index 6894d28..73e4ac2 100644 (file)
@@ -37,6 +37,8 @@ trait ApiMessageTrait {
                'badipaddress' => 'invalidip',
                'blankpage' => 'emptypage',
                'blockedtext' => 'blocked',
+               'blockedtext-composite' => 'blocked',
+               'blockedtext-partial' => 'blocked',
                'cannotdelete' => 'cantdelete',
                'cannotundelete' => 'cantundelete',
                'cantmove-titleprotected' => 'protectedtitle',
index 536de24..bba9d5a 100644 (file)
@@ -180,7 +180,13 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase {
        }
 
        public static function setUpBeforeClass() {
+               global $IP;
                parent::setUpBeforeClass();
+               if ( !file_exists( "$IP/LocalSettings.php" ) ) {
+                       echo 'A working MediaWiki installation with a configured LocalSettings.php file is'
+                       . ' required for tests that extend ' . self::class;
+                       die();
+               }
                self::initializeForStandardPhpunitEntrypointIfNeeded();
 
                // Get the original service locator