$row->rc_foo = 'AAA';
$row->rc_timestamp = '20150921134808';
$row->rc_deleted = 'bar';
+ $row->rc_comment_text = 'comment';
+ $row->rc_comment_data = null;
$rc = RecentChange::newFromRow( $row );
'rc_foo' => 'AAA',
'rc_timestamp' => '20150921134808',
'rc_deleted' => 'bar',
+ 'rc_comment' => 'comment',
+ 'rc_comment_text' => 'comment',
+ 'rc_comment_data' => null,
+ ];
+ $this->assertEquals( $expected, $rc->getAttributes() );
+
+ $row = new stdClass();
+ $row->rc_foo = 'AAA';
+ $row->rc_timestamp = '20150921134808';
+ $row->rc_deleted = 'bar';
+ $row->rc_comment = 'comment';
+
+ MediaWiki\suppressWarnings();
+ $rc = RecentChange::newFromRow( $row );
+ MediaWiki\restoreWarnings();
+
+ $expected = [
+ 'rc_foo' => 'AAA',
+ 'rc_timestamp' => '20150921134808',
+ 'rc_deleted' => 'bar',
+ 'rc_comment' => 'comment',
+ 'rc_comment_text' => 'comment',
+ 'rc_comment_data' => null,
];
$this->assertEquals( $expected, $rc->getAttributes() );
}