diff options
author | Kai_WMDE <kai.nissen@wikimedia.de> | 2015-05-17 18:09:59 +0200 |
---|---|---|
committer | Kai_WMDE <kai.nissen@wikimedia.de> | 2015-08-13 17:58:06 +0200 |
commit | f6879ea16edf008eb012bd4dbe133e2ba4b9338f (patch) | |
tree | e58cf2cc7f75f15576c5db4f58e1b2f55b5dce2f /tests/phpunit/includes/changes/TestRecentChangesHelper.php | |
parent | 0a9ee5d9bf0047ec65c29ee35321d96191ecbff5 (diff) | |
download | mediawikicore-f6879ea16edf008eb012bd4dbe133e2ba4b9338f.tar.gz mediawikicore-f6879ea16edf008eb012bd4dbe133e2ba4b9338f.zip |
Enable users to watch category membership changes
Bug: T9148
Change-Id: I5a89d8f19804b1120f4c755d834e2da6ca12ceae
Diffstat (limited to 'tests/phpunit/includes/changes/TestRecentChangesHelper.php')
-rw-r--r-- | tests/phpunit/includes/changes/TestRecentChangesHelper.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/phpunit/includes/changes/TestRecentChangesHelper.php b/tests/phpunit/includes/changes/TestRecentChangesHelper.php index 2506087bfaa4..e59825a9f55a 100644 --- a/tests/phpunit/includes/changes/TestRecentChangesHelper.php +++ b/tests/phpunit/includes/changes/TestRecentChangesHelper.php @@ -97,6 +97,36 @@ class TestRecentChangesHelper { return $change; } + public function getCacheEntry( $recentChange ) { + $rcCacheFactory = new RCCacheEntryFactory( + new RequestContext(), + array( 'diff' => 'diff', 'cur' => 'cur', 'last' => 'last' ) + ); + return $rcCacheFactory->newFromRecentChange( $recentChange, false ); + } + + public function makeCategorizationRecentChange( + User $user, $titleText, $curid, $thisid, $lastid, $timestamp + ) { + + $attribs = array_merge( + $this->getDefaultAttributes( $titleText, $timestamp ), + array( + 'rc_type' => RC_CATEGORIZE, + 'rc_user' => $user->getId(), + 'rc_user_text' => $user->getName(), + 'rc_this_oldid' => $thisid, + 'rc_last_oldid' => $lastid, + 'rc_cur_id' => $curid, + 'rc_comment' => '[[:Testpage]] added to category', + 'rc_old_len' => 0, + 'rc_new_len' => 0, + ) + ); + + return $this->makeRecentChange( $attribs, 0, 0 ); + } + private function getDefaultAttributes( $titleText, $timestamp ) { return array( 'rc_id' => 545, |