Add `actor` table and code to start using it
[lhc/web/wiklou.git] / tests / phpunit / includes / import / ImportTest.php
index 347d0fc..3b91f5b 100644 (file)
@@ -37,7 +37,7 @@ class ImportTest extends MediaWikiLangTestCase {
        }
 
        public function getUnknownTagsXML() {
-               // @codingStandardsIgnoreStart Generic.Files.LineLength
+               // phpcs:disable Generic.Files.LineLength
                return [
                        [
                                <<< EOF
@@ -71,7 +71,7 @@ EOF
                                'TestImportPage'
                        ]
                ];
-               // @codingStandardsIgnoreEnd
+               // phpcs:enable
        }
 
        /**
@@ -102,7 +102,7 @@ EOF
        }
 
        public function getRedirectXML() {
-               // @codingStandardsIgnoreStart Generic.Files.LineLength
+               // phpcs:disable Generic.Files.LineLength
                return [
                        [
                                <<< EOF
@@ -157,7 +157,7 @@ EOF
                                null
                        ],
                ];
-               // @codingStandardsIgnoreEnd
+               // phpcs:enable
        }
 
        /**
@@ -185,7 +185,7 @@ EOF
        }
 
        public function getSiteInfoXML() {
-               // @codingStandardsIgnoreStart Generic.Files.LineLength
+               // phpcs:disable Generic.Files.LineLength
                return [
                        [
                                <<< EOF
@@ -217,7 +217,7 @@ EOF
                                ]
                        ],
                ];
-               // @codingStandardsIgnoreEnd
+               // phpcs:enable
        }
 
        /**
@@ -248,7 +248,7 @@ EOF
 
                $n = ( $assign ? 1 : 0 ) + ( $create ? 2 : 0 );
 
-               // @codingStandardsIgnoreStart Generic.Files.LineLength
+               // phpcs:disable Generic.Files.LineLength
                $source = $this->getDataSource( <<<EOF
 <mediawiki xmlns="http://www.mediawiki.org/xml/export-0.10/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.10/ http://www.mediawiki.org/xml/export-0.10.xsd" version="0.10" xml:lang="en">
   <page>
@@ -283,19 +283,22 @@ EOF
 </mediawiki>
 EOF
                );
-               // @codingStandardsIgnoreEnd
+               // phpcs:enable
 
                $importer = new WikiImporter( $source, MediaWikiServices::getInstance()->getMainConfig() );
                $importer->setUsernamePrefix( 'Xxx', $assign );
                $importer->doImport();
 
                $db = wfGetDB( DB_MASTER );
+               $revQuery = Revision::getQueryInfo();
 
                $row = $db->selectRow(
-                       'revision',
-                       [ 'rev_user', 'rev_user_text' ],
+                       $revQuery['tables'],
+                       $revQuery['fields'],
                        [ 'rev_timestamp' => $db->timestamp( "201601010{$n}0000" ) ],
-                       __METHOD__
+                       __METHOD__,
+                       [],
+                       $revQuery['joins']
                );
                $this->assertSame(
                        $assign && $create ? 'UserDoesNotExist' : 'Xxx>UserDoesNotExist',
@@ -304,10 +307,12 @@ EOF
                $this->assertSame( $assign && $create ? $hookId : 0, (int)$row->rev_user );
 
                $row = $db->selectRow(
-                       'revision',
-                       [ 'rev_user', 'rev_user_text' ],
+                       $revQuery['tables'],
+                       $revQuery['fields'],
                        [ 'rev_timestamp' => $db->timestamp( "201601010{$n}0001" ) ],
-                       __METHOD__
+                       __METHOD__,
+                       [],
+                       $revQuery['joins']
                );
                $this->assertSame( ( $assign ? '' : 'Xxx>' ) . $user->getName(), $row->rev_user_text );
                $this->assertSame( $assign ? $user->getId() : 0, (int)$row->rev_user );