Bidi isolate user names in block error paramters
[lhc/web/wiklou.git] / tests / phpunit / includes / logging / DatabaseLogEntryTest.php
index 4af1742..b183cde 100644 (file)
@@ -29,17 +29,16 @@ class DatabaseLogEntryTest extends MediaWikiTestCase {
         * @param array $selectFields
         * @param string[]|null $row
         * @param string[]|null $expectedFields
-        * @param string $migration
+        * @param int $actorMigration
         */
        public function testNewFromId( $id,
                array $selectFields,
                array $row = null,
                array $expectedFields = null,
-               $migration
+               $actorMigration
        ) {
                $this->setMwGlobals( [
-                       'wgCommentTableSchemaMigrationStage' => $migration,
-                       'wgActorTableSchemaMigrationStage' => $migration,
+                       'wgActorTableSchemaMigrationStage' => $actorMigration,
                ] );
 
                $row = $row ? (object)$row : null;
@@ -69,7 +68,10 @@ class DatabaseLogEntryTest extends MediaWikiTestCase {
 
        public function provideNewFromId() {
                $oldTables = [
-                       'tables' => [ 'logging', 'user' ],
+                       'tables' => [
+                               'logging', 'user',
+                               'comment_log_comment' => 'comment',
+                       ],
                        'fields' => [
                                'log_id',
                                'log_type',
@@ -82,15 +84,18 @@ class DatabaseLogEntryTest extends MediaWikiTestCase {
                                'user_id',
                                'user_name',
                                'user_editcount',
-                               'log_comment_text' => 'log_comment',
-                               'log_comment_data' => 'NULL',
-                               'log_comment_cid' => 'NULL',
+                               'log_comment_text' => 'comment_log_comment.comment_text',
+                               'log_comment_data' => 'comment_log_comment.comment_data',
+                               'log_comment_cid' => 'comment_log_comment.comment_id',
                                'log_user' => 'log_user',
                                'log_user_text' => 'log_user_text',
                                'log_actor' => 'NULL',
                        ],
                        'options' => [],
-                       'join_conds' => [ 'user' => [ 'LEFT JOIN', 'user_id=log_user' ] ],
+                       'join_conds' => [
+                               'user' => [ 'LEFT JOIN', 'user_id=log_user' ],
+                               'comment_log_comment' => [ 'JOIN', 'comment_log_comment.comment_id = log_comment_id' ],
+                       ],
                ];
                $newTables = [
                        'tables' => [
@@ -131,7 +136,7 @@ class DatabaseLogEntryTest extends MediaWikiTestCase {
                                $oldTables + [ 'conds' => [ 'log_id' => 0 ] ],
                                null,
                                null,
-                               MIGRATION_OLD,
+                               SCHEMA_COMPAT_OLD,
                        ],
                        [
                                123,
@@ -143,7 +148,7 @@ class DatabaseLogEntryTest extends MediaWikiTestCase {
                                        'log_comment_data' => null,
                                ],
                                [ 'type' => 'foobarize', 'comment' => 'test!' ],
-                               MIGRATION_OLD,
+                               SCHEMA_COMPAT_OLD,
                        ],
                        [
                                567,
@@ -155,7 +160,7 @@ class DatabaseLogEntryTest extends MediaWikiTestCase {
                                        'log_comment_data' => null,
                                ],
                                [ 'type' => 'foobarize', 'comment' => 'test!' ],
-                               MIGRATION_NEW,
+                               SCHEMA_COMPAT_NEW,
                        ],
                ];
        }