From: addshore Date: Mon, 21 Sep 2015 13:51:44 +0000 (+0100) Subject: Add test for RecentChange::newFromRow X-Git-Tag: 1.31.0-rc.0~9938 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;ds=sidebyside;h=9705da62e1437db4a90eae1fa1ec9d45ae8c1635;p=lhc%2Fweb%2Fwiklou.git Add test for RecentChange::newFromRow Change-Id: I1e21d296e15c1b6d18f19ae9cc7038387c8f4e2b --- diff --git a/tests/phpunit/includes/changes/RecentChangeTest.php b/tests/phpunit/includes/changes/RecentChangeTest.php index 0092ac255b..beb911f2fb 100644 --- a/tests/phpunit/includes/changes/RecentChangeTest.php +++ b/tests/phpunit/includes/changes/RecentChangeTest.php @@ -21,6 +21,26 @@ class RecentChangeTest extends MediaWikiTestCase { $this->context = RequestContext::newExtraneousContext( $this->title ); } + /** + * @covers RecentChange::newFromRow + * @covers RecentChange::loadFromRow + */ + public function testNewFromRow() { + $row = new stdClass(); + $row->rc_foo = 'AAA'; + $row->rc_timestamp = '20150921134808'; + $row->rc_deleted = 'bar'; + + $rc = RecentChange::newFromRow( $row ); + + $expected = array( + 'rc_foo' => 'AAA', + 'rc_timestamp' => '20150921134808', + 'rc_deleted' => 'bar', + ); + $this->assertEquals( $expected, $rc->getAttributes() ); + } + /** * The testIrcMsgForAction* tests are supposed to cover the hacky * LogFormatter::getIRCActionText / bug 34508