dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add support for 'hu-formal'"
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
changes
/
RecentChangeTest.php
diff --git
a/tests/phpunit/includes/changes/RecentChangeTest.php
b/tests/phpunit/includes/changes/RecentChangeTest.php
index
d638d0f
..
333eb28
100644
(file)
--- a/
tests/phpunit/includes/changes/RecentChangeTest.php
+++ b/
tests/phpunit/includes/changes/RecentChangeTest.php
@@
-27,12
+27,16
@@
class RecentChangeTest extends MediaWikiTestCase {
* @covers RecentChange::loadFromRow
*/
public function testNewFromRow() {
* @covers RecentChange::loadFromRow
*/
public function testNewFromRow() {
+ $user = $this->getTestUser()->getUser();
+ $actorId = $user->getActorId();
+
$row = new stdClass();
$row->rc_foo = 'AAA';
$row->rc_timestamp = '20150921134808';
$row->rc_deleted = 'bar';
$row->rc_comment_text = 'comment';
$row->rc_comment_data = null;
$row = new stdClass();
$row->rc_foo = 'AAA';
$row->rc_timestamp = '20150921134808';
$row->rc_deleted = 'bar';
$row->rc_comment_text = 'comment';
$row->rc_comment_data = null;
+ $row->rc_user = $user->getId();
$rc = RecentChange::newFromRow( $row );
$rc = RecentChange::newFromRow( $row );
@@
-43,6
+47,9
@@
class RecentChangeTest extends MediaWikiTestCase {
'rc_comment' => 'comment',
'rc_comment_text' => 'comment',
'rc_comment_data' => null,
'rc_comment' => 'comment',
'rc_comment_text' => 'comment',
'rc_comment_data' => null,
+ 'rc_user' => $user->getId(),
+ 'rc_user_text' => $user->getName(),
+ 'rc_actor' => $actorId,
];
$this->assertEquals( $expected, $rc->getAttributes() );
];
$this->assertEquals( $expected, $rc->getAttributes() );
@@
-51,10
+58,11
@@
class RecentChangeTest extends MediaWikiTestCase {
$row->rc_timestamp = '20150921134808';
$row->rc_deleted = 'bar';
$row->rc_comment = 'comment';
$row->rc_timestamp = '20150921134808';
$row->rc_deleted = 'bar';
$row->rc_comment = 'comment';
+ $row->rc_user = $user->getId();
-
MediaWiki
\suppressWarnings();
+
Wikimedia
\suppressWarnings();
$rc = RecentChange::newFromRow( $row );
$rc = RecentChange::newFromRow( $row );
-
MediaWiki
\restoreWarnings();
+
Wikimedia
\restoreWarnings();
$expected = [
'rc_foo' => 'AAA',
$expected = [
'rc_foo' => 'AAA',
@@
-63,6
+71,9
@@
class RecentChangeTest extends MediaWikiTestCase {
'rc_comment' => 'comment',
'rc_comment_text' => 'comment',
'rc_comment_data' => null,
'rc_comment' => 'comment',
'rc_comment_text' => 'comment',
'rc_comment_data' => null,
+ 'rc_user' => $user->getId(),
+ 'rc_user_text' => $user->getName(),
+ 'rc_actor' => $actorId,
];
$this->assertEquals( $expected, $rc->getAttributes() );
}
];
$this->assertEquals( $expected, $rc->getAttributes() );
}