Fix Revison typo
[lhc/web/wiklou.git] / tests / phpunit / includes / page / WikiPageDbTestBase.php
index fee4583..298dc52 100644 (file)
@@ -135,6 +135,9 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase {
                }
 
                $updater->saveRevision( CommentStoreComment::newUnsavedComment( "testing" ) );
+               if ( !$updater->wasSuccessful() ) {
+                       $this->fail( $updater->getStatus()->getWikiText() );
+               }
 
                return $page;
        }
@@ -463,12 +466,13 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase {
                );
                $logId = $status->getValue();
                $actorQuery = ActorMigration::newMigration()->getJoin( 'log_user' );
+               $commentQuery = MediaWikiServices::getInstance()->getCommentStore()->getJoin( 'log_comment' );
                $this->assertSelect(
-                       [ 'logging' ] + $actorQuery['tables'], /* table */
+                       [ 'logging' ] + $actorQuery['tables'] + $commentQuery['tables'], /* table */
                        [
                                'log_type',
                                'log_action',
-                               'log_comment',
+                               'log_comment' => $commentQuery['fields']['log_comment_text'],
                                'log_user' => $actorQuery['fields']['log_user'],
                                'log_user_text' => $actorQuery['fields']['log_user_text'],
                                'log_namespace',
@@ -485,7 +489,7 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase {
                                $page->getTitle()->getDBkey(),
                        ] ],
                        [],
-                       $actorQuery['joins']
+                       $actorQuery['joins'] + $commentQuery['joins']
                );
        }
 
@@ -512,12 +516,13 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase {
                );
                $logId = $status->getValue();
                $actorQuery = ActorMigration::newMigration()->getJoin( 'log_user' );
+               $commentQuery = MediaWikiServices::getInstance()->getCommentStore()->getJoin( 'log_comment' );
                $this->assertSelect(
-                       [ 'logging' ] + $actorQuery['tables'], /* table */
+                       [ 'logging' ] + $actorQuery['tables'] + $commentQuery['tables'], /* table */
                        [
                                'log_type',
                                'log_action',
-                               'log_comment',
+                               'log_comment' => $commentQuery['fields']['log_comment_text'],
                                'log_user' => $actorQuery['fields']['log_user'],
                                'log_user_text' => $actorQuery['fields']['log_user_text'],
                                'log_namespace',
@@ -534,7 +539,7 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase {
                                $page->getTitle()->getDBkey(),
                        ] ],
                        [],
-                       $actorQuery['joins']
+                       $actorQuery['joins'] + $commentQuery['joins']
                );
        }
 
@@ -563,12 +568,13 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase {
                );
                $logId = $status->getValue();
                $actorQuery = ActorMigration::newMigration()->getJoin( 'log_user' );
+               $commentQuery = MediaWikiServices::getInstance()->getCommentStore()->getJoin( 'log_comment' );
                $this->assertSelect(
-                       [ 'logging' ] + $actorQuery['tables'], /* table */
+                       [ 'logging' ] + $actorQuery['tables'] + $commentQuery['tables'], /* table */
                        [
                                'log_type',
                                'log_action',
-                               'log_comment',
+                               'log_comment' => $commentQuery['fields']['log_comment_text'],
                                'log_user' => $actorQuery['fields']['log_user'],
                                'log_user_text' => $actorQuery['fields']['log_user_text'],
                                'log_namespace',
@@ -585,7 +591,7 @@ abstract class WikiPageDbTestBase extends MediaWikiLangTestCase {
                                $page->getTitle()->getDBkey(),
                        ] ],
                        [],
-                       $actorQuery['joins']
+                       $actorQuery['joins'] + $commentQuery['joins']
                );
 
                $this->assertNull(
@@ -2042,7 +2048,7 @@ more stuff
                        wfTimestamp( TS_UNIX, $initialRevision->getTimestamp() ) - 1
                );
 
-               $olderRevison = new Revision(
+               $olderRevision = new Revision(
                        [
                                'id' => 9989,
                                'page' => $page->getId(),
@@ -2059,7 +2065,7 @@ more stuff
                        ]
                );
 
-               $result = $page->updateIfNewerOn( $this->db, $olderRevison );
+               $result = $page->updateIfNewerOn( $this->db, $olderRevision );
                $this->assertFalse( $result );
        }
 
@@ -2266,10 +2272,11 @@ more stuff
                // Make sure the log entry looks good
                // log_params is not checked here
                $actorQuery = ActorMigration::newMigration()->getJoin( 'log_user' );
+               $commentQuery = MediaWikiServices::getInstance()->getCommentStore()->getJoin( 'log_comment' );
                $this->assertSelect(
-                       [ 'logging' ] + $actorQuery['tables'],
+                       [ 'logging' ] + $actorQuery['tables'] + $commentQuery['tables'],
                        [
-                               'log_comment',
+                               'log_comment' => $commentQuery['fields']['log_comment_text'],
                                'log_user' => $actorQuery['fields']['log_user'],
                                'log_user_text' => $actorQuery['fields']['log_user_text'],
                                'log_namespace',
@@ -2284,7 +2291,7 @@ more stuff
                                $page->getTitle()->getDBkey(),
                        ] ],
                        [],
-                       $actorQuery['joins']
+                       $actorQuery['joins'] + $commentQuery['joins']
                );
        }