Join slot and content tables when dumping XML
[lhc/web/wiklou.git] / tests / phpunit / includes / Revision / RevisionQueryInfoTest.php
index 9f1c69c..57619c5 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+
 namespace MediaWiki\Tests\Revision;
 
 use MediaWiki\MediaWikiServices;
@@ -244,7 +245,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                                        $this->getNewCommentQueryFields( 'rev' )
                                ),
                                'joins' => [
-                                       'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ] ],
+                                       'page' => [ 'JOIN', [ 'page_id = rev_page' ] ],
                                        'user' => [
                                                'LEFT JOIN',
                                                [ 'actor_rev_user.actor_user != 0', 'user_id = actor_rev_user.actor_user' ],
@@ -289,7 +290,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                                ),
                                'joins' => array_merge(
                                        [
-                                               'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ] ],
+                                               'page' => [ 'JOIN', [ 'page_id = rev_page' ] ],
                                                'user' => [
                                                        'LEFT JOIN',
                                                        [
@@ -332,7 +333,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                                ),
                                'joins' => array_merge(
                                        [
-                                               'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ] ],
+                                               'page' => [ 'JOIN', [ 'page_id = rev_page' ] ],
                                                'user' => [
                                                        'LEFT JOIN',
                                                        [
@@ -401,7 +402,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                                ),
                                'joins' => array_merge(
                                        [
-                                               'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ] ],
+                                               'page' => [ 'JOIN', [ 'page_id = rev_page' ] ],
                                                'user' => [
                                                        'LEFT JOIN',
                                                        [
@@ -464,7 +465,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                                        $this->getNewCommentQueryFields( 'rev' )
                                ),
                                'joins' => [
-                                       'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ] ],
+                                       'page' => [ 'JOIN', [ 'page_id = rev_page' ] ],
                                        'user' => [ 'LEFT JOIN', [ 'rev_user != 0', 'user_id = rev_user' ] ],
                                        'temp_rev_comment' => [ 'JOIN', 'temp_rev_comment.revcomment_rev = rev_id' ],
                                        'comment_rev_comment'
@@ -517,7 +518,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                                        $this->getNewCommentQueryFields( 'rev' )
                                ),
                                'joins' => [
-                                       'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ], ],
+                                       'page' => [ 'JOIN', [ 'page_id = rev_page' ], ],
                                        'temp_rev_comment' => [ 'JOIN', 'temp_rev_comment.revcomment_rev = rev_id' ],
                                        'comment_rev_comment'
                                                => [ 'JOIN', 'comment_rev_comment.comment_id = temp_rev_comment.revcomment_comment_id' ],
@@ -571,7 +572,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                                        $this->getNewCommentQueryFields( 'rev' )
                                ),
                                'joins' => [
-                                       'text' => [ 'INNER JOIN', [ 'rev_text_id=old_id' ] ],
+                                       'text' => [ 'JOIN', [ 'rev_text_id=old_id' ] ],
                                        'temp_rev_comment' => [ 'JOIN', 'temp_rev_comment.revcomment_rev = rev_id' ],
                                        'comment_rev_comment'
                                                => [ 'JOIN', 'comment_rev_comment.comment_id = temp_rev_comment.revcomment_comment_id' ],
@@ -601,7 +602,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                                ),
                                'joins' => [
                                        'page' => [
-                                               'INNER JOIN',
+                                               'JOIN',
                                                [ 'page_id = rev_page' ],
                                        ],
                                        'user' => [
@@ -612,7 +613,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                                                ],
                                        ],
                                        'text' => [
-                                               'INNER JOIN',
+                                               'JOIN',
                                                [ 'rev_text_id=old_id' ],
                                        ],
                                        'temp_rev_comment' => [ 'JOIN', 'temp_rev_comment.revcomment_rev = rev_id' ],
@@ -686,7 +687,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                                        'content_model',
                                ],
                                'joins' => [
-                                       'content' => [ 'INNER JOIN', [ 'slot_content_id = content_id' ] ],
+                                       'content' => [ 'JOIN', [ 'slot_content_id = content_id' ] ],
                                ],
                        ]
                ];
@@ -714,7 +715,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                                        'model_name',
                                ],
                                'joins' => [
-                                       'content' => [ 'INNER JOIN', [ 'slot_content_id = content_id' ] ],
+                                       'content' => [ 'JOIN', [ 'slot_content_id = content_id' ] ],
                                        'content_models' => [ 'LEFT JOIN', [ 'content_model = model_id' ] ],
                                ],
                        ]
@@ -730,13 +731,13 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                        [],
                        [
                                'tables' => [
-                                       'slots' => 'revision',
+                                       'revision',
                                ],
                                'fields' => array_merge(
                                        [
-                                               'slot_revision_id' => 'slots.rev_id',
+                                               'slot_revision_id' => 'rev_id',
                                                'slot_content_id' => 'NULL',
-                                               'slot_origin' => 'slots.rev_id',
+                                               'slot_origin' => 'rev_id',
                                                'role_name' => $db->addQuotes( SlotRecord::MAIN ),
                                        ]
                                ),
@@ -751,19 +752,20 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                        [ 'content' ],
                        [
                                'tables' => [
-                                       'slots' => 'revision',
+                                       'revision',
                                ],
                                'fields' => array_merge(
                                        [
-                                               'slot_revision_id' => 'slots.rev_id',
+                                               'slot_revision_id' => 'rev_id',
                                                'slot_content_id' => 'NULL',
-                                               'slot_origin' => 'slots.rev_id',
+                                               'slot_origin' => 'rev_id',
                                                'role_name' => $db->addQuotes( SlotRecord::MAIN ),
-                                               'content_size' => 'slots.rev_len',
-                                               'content_sha1' => 'slots.rev_sha1',
+                                               'content_size' => 'rev_len',
+                                               'content_sha1' => 'rev_sha1',
                                                'content_address' => $db->buildConcat( [
-                                                       $db->addQuotes( 'tt:' ), 'slots.rev_text_id' ] ),
-                                               'model_name' => 'slots.rev_content_model',
+                                                       $db->addQuotes( 'tt:' ), 'rev_text_id' ] ),
+                                               'rev_text_id' => 'rev_text_id',
+                                               'model_name' => 'rev_content_model',
                                        ]
                                ),
                                'joins' => [],
@@ -777,19 +779,20 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                        [ 'content', 'model', 'role' ],
                        [
                                'tables' => [
-                                       'slots' => 'revision',
+                                       'revision',
                                ],
                                'fields' => array_merge(
                                        [
-                                               'slot_revision_id' => 'slots.rev_id',
+                                               'slot_revision_id' => 'rev_id',
                                                'slot_content_id' => 'NULL',
-                                               'slot_origin' => 'slots.rev_id',
+                                               'slot_origin' => 'rev_id',
                                                'role_name' => $db->addQuotes( SlotRecord::MAIN ),
-                                               'content_size' => 'slots.rev_len',
-                                               'content_sha1' => 'slots.rev_sha1',
+                                               'content_size' => 'rev_len',
+                                               'content_sha1' => 'rev_sha1',
                                                'content_address' => $db->buildConcat( [
-                                                       $db->addQuotes( 'tt:' ), 'slots.rev_text_id' ] ),
-                                               'model_name' => 'slots.rev_content_model',
+                                                       $db->addQuotes( 'tt:' ), 'rev_text_id' ] ),
+                                               'rev_text_id' => 'rev_text_id',
+                                               'model_name' => 'rev_content_model',
                                        ]
                                ),
                                'joins' => [],
@@ -803,13 +806,13 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                        [],
                        [
                                'tables' => [
-                                       'slots' => 'revision',
+                                       'revision',
                                ],
                                'fields' => array_merge(
                                        [
-                                               'slot_revision_id' => 'slots.rev_id',
+                                               'slot_revision_id' => 'rev_id',
                                                'slot_content_id' => 'NULL',
-                                               'slot_origin' => 'slots.rev_id',
+                                               'slot_origin' => 'rev_id',
                                                'role_name' => $db->addQuotes( SlotRecord::MAIN ),
                                        ]
                                ),
@@ -824,19 +827,20 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
                        [ 'content' ],
                        [
                                'tables' => [
-                                       'slots' => 'revision',
+                                       'revision',
                                ],
                                'fields' => array_merge(
                                        [
-                                               'slot_revision_id' => 'slots.rev_id',
+                                               'slot_revision_id' => 'rev_id',
                                                'slot_content_id' => 'NULL',
-                                               'slot_origin' => 'slots.rev_id',
+                                               'slot_origin' => 'rev_id',
                                                'role_name' => $db->addQuotes( SlotRecord::MAIN ),
-                                               'content_size' => 'slots.rev_len',
-                                               'content_sha1' => 'slots.rev_sha1',
+                                               'content_size' => 'rev_len',
+                                               'content_sha1' => 'rev_sha1',
                                                'content_address' =>
-                                                       $db->buildConcat( [ $db->addQuotes( 'tt:' ), 'slots.rev_text_id' ] ),
-                                               'model_name' => 'slots.rev_content_model',
+                                                       $db->buildConcat( [ $db->addQuotes( 'tt:' ), 'rev_text_id' ] ),
+                                               'rev_text_id' => 'rev_text_id',
+                                               'model_name' => 'rev_content_model',
                                        ]
                                ),
                                'joins' => [],
@@ -993,7 +997,7 @@ class RevisionQueryInfoTest extends MediaWikiTestCase {
        public function testRevisionPageJoinCond() {
                $this->hideDeprecated( 'Revision::pageJoinCond' );
                $this->assertEquals(
-                       [ 'INNER JOIN', [ 'page_id = rev_page' ] ],
+                       [ 'JOIN', [ 'page_id = rev_page' ] ],
                        Revision::pageJoinCond()
                );
        }