* @param array $selectFields
* @param string[]|null $row
* @param string[]|null $expectedFields
- * @param string $migration
*/
public function testNewFromId( $id,
array $selectFields,
array $row = null,
- array $expectedFields = null,
- $migration
+ array $expectedFields = null
) {
- $this->setMwGlobals( [
- 'wgCommentTableSchemaMigrationStage' => $migration,
- 'wgActorTableSchemaMigrationStage' => $migration,
- ] );
-
$row = $row ? (object)$row : null;
$db = $this->getMock( IDatabase::class );
$db->expects( self::once() )
}
public function provideNewFromId() {
- $oldTables = [
- 'tables' => [ 'logging', 'user' ],
- 'fields' => [
- 'log_id',
- 'log_type',
- 'log_action',
- 'log_timestamp',
- 'log_namespace',
- 'log_title',
- 'log_params',
- 'log_deleted',
- 'user_id',
- 'user_name',
- 'user_editcount',
- 'log_comment_text' => 'log_comment',
- 'log_comment_data' => 'NULL',
- 'log_comment_cid' => 'NULL',
- 'log_user' => 'log_user',
- 'log_user_text' => 'log_user_text',
- 'log_actor' => 'NULL',
- ],
- 'options' => [],
- 'join_conds' => [ 'user' => [ 'LEFT JOIN', 'user_id=log_user' ] ],
- ];
$newTables = [
'tables' => [
'logging',
return [
[
0,
- $oldTables + [ 'conds' => [ 'log_id' => 0 ] ],
- null,
+ $newTables + [ 'conds' => [ 'log_id' => 0 ] ],
null,
- MIGRATION_OLD,
+ null
],
[
123,
- $oldTables + [ 'conds' => [ 'log_id' => 123 ] ],
+ $newTables + [ 'conds' => [ 'log_id' => 123 ] ],
[
'log_id' => 123,
'log_type' => 'foobarize',
'log_comment_text' => 'test!',
'log_comment_data' => null,
],
- [ 'type' => 'foobarize', 'comment' => 'test!' ],
- MIGRATION_OLD,
+ [ 'type' => 'foobarize', 'comment' => 'test!' ]
],
[
567,
'log_comment_text' => 'test!',
'log_comment_data' => null,
],
- [ 'type' => 'foobarize', 'comment' => 'test!' ],
- MIGRATION_NEW,
+ [ 'type' => 'foobarize', 'comment' => 'test!' ]
],
];
}