X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Flogging%2FDatabaseLogEntryTest.php;h=b183cde1d28cf5ac172dcf661adf8739c44c0018;hb=8cfa62d8376bdcde687dad1837f08bac6f82f09e;hp=4af1742e1aae55c0616ef791a3d7f72949e434d1;hpb=1621c57c3724a66c487a65f46940a6e0e4dc4dea;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/logging/DatabaseLogEntryTest.php b/tests/phpunit/includes/logging/DatabaseLogEntryTest.php index 4af1742e1a..b183cde1d2 100644 --- a/tests/phpunit/includes/logging/DatabaseLogEntryTest.php +++ b/tests/phpunit/includes/logging/DatabaseLogEntryTest.php @@ -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, ], ]; }