* @param array $selectFields
* @param string[]|null $row
* @param string[]|null $expectedFields
- * @param int $commentMigration
* @param int $actorMigration
*/
public function testNewFromId( $id,
array $selectFields,
array $row = null,
array $expectedFields = null,
- $commentMigration,
$actorMigration
) {
$this->setMwGlobals( [
- 'wgCommentTableSchemaMigrationStage' => $commentMigration,
'wgActorTableSchemaMigrationStage' => $actorMigration,
] );
public function provideNewFromId() {
$oldTables = [
- 'tables' => [ 'logging', 'user' ],
+ 'tables' => [
+ 'logging', 'user',
+ 'comment_log_comment' => 'comment',
+ ],
'fields' => [
'log_id',
'log_type',
'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' => [
$oldTables + [ 'conds' => [ 'log_id' => 0 ] ],
null,
null,
- MIGRATION_OLD,
SCHEMA_COMPAT_OLD,
],
[
'log_comment_data' => null,
],
[ 'type' => 'foobarize', 'comment' => 'test!' ],
- MIGRATION_OLD,
SCHEMA_COMPAT_OLD,
],
[
'log_comment_data' => null,
],
[ 'type' => 'foobarize', 'comment' => 'test!' ],
- MIGRATION_NEW,
SCHEMA_COMPAT_NEW,
],
];