Add $logAction param for test recent changes helper
authoraude <aude.wiki@gmail.com>
Fri, 25 Jul 2014 16:39:07 +0000 (18:39 +0200)
committerAddshore <addshorewiki@gmail.com>
Fri, 29 Aug 2014 11:33:23 +0000 (11:33 +0000)
to allow testing with various types of log actions

Change-Id: Idc78c964a68e98239265aaaa9e7913d477a3298f

tests/phpunit/includes/changes/OldChangesListTest.php
tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php
tests/phpunit/includes/changes/TestRecentChangesHelper.php

index 9783ae3..7225356 100644 (file)
@@ -68,7 +68,7 @@ class OldChangesListTest extends MediaWikiLangTestCase {
 
        public function testRecentChangesLine_LogTitle() {
                $oldChangesList = $this->getOldChangesList();
-               $recentChange = $this->getLogChange( 'delete' );
+               $recentChange = $this->getLogChange( 'delete', 'delete' );
 
                $line = $oldChangesList->recentChangesLine( $recentChange, false, 1 );
 
@@ -110,11 +110,11 @@ class OldChangesListTest extends MediaWikiLangTestCase {
                return $recentChange;
        }
 
-       private function getLogChange( $logType ) {
+       private function getLogChange( $logType, $logAction ) {
                $user = $this->getTestUser();
 
                $recentChange = $this->testRecentChangesHelper->makeLogRecentChange(
-                       $logType, $user, 'Abc', '20131103212153', 0, 0
+                       $logType, $logAction, $user, 'Abc', '20131103212153', 0, 0
                );
 
                return $recentChange;
index c3b8ce6..ee1a4d0 100644 (file)
@@ -123,6 +123,7 @@ class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
                                $this->getContext(),
                                $this->getMessages(),
                                $this->testRecentChangesHelper->makeLogRecentChange(
+                                       'delete',
                                        'delete',
                                        $this->getTestUser(),
                                        'Abc',
index bb6ebec..0da0775 100644 (file)
@@ -26,7 +26,7 @@ class TestRecentChangesHelper {
                return $this->makeRecentChange( $attribs, $counter, $watchingUsers );
        }
 
-       public function makeLogRecentChange( $logType, User $user, $titleText, $timestamp, $counter,
+       public function makeLogRecentChange( $logType, $logAction, User $user, $titleText, $timestamp, $counter,
                $watchingUsers
        ) {
                $attribs = array_merge(
@@ -42,7 +42,7 @@ class TestRecentChangesHelper {
                                'rc_type' => 3,
                                'rc_logid' => 25,
                                'rc_log_type' => $logType,
-                               'rc_log_action' => $logType,
+                               'rc_log_action' => $logAction,
                                'rc_source' => 'mw.log'
                        )
                );