Fix undefined argument in OldChangesList
authoraude <aude.wiki@gmail.com>
Sat, 6 Sep 2014 16:40:52 +0000 (18:40 +0200)
committeraude <aude.wiki@gmail.com>
Tue, 9 Sep 2014 14:05:53 +0000 (16:05 +0200)
Bug: 70407
Change-Id: I17bbaeaf7c9cae51e33c859867ef3a3199b68a43

includes/changes/OldChangesList.php
tests/phpunit/includes/changes/OldChangesListTest.php

index b779a02..4eed926 100644 (file)
@@ -49,7 +49,7 @@ class OldChangesList extends ChangesList {
                $classes[] = $watched && $rc->mAttribs['rc_timestamp'] >= $watched
                        ? 'mw-changeslist-line-watched' : 'mw-changeslist-line-not-watched';
 
-               $html = $this->formatChangeLine( $rc, $watched );
+               $html = $this->formatChangeLine( $rc, $classes, $watched );
 
                if ( $this->watchlist ) {
                        $classes[] = Sanitizer::escapeClass( 'watchlist-' .
@@ -72,11 +72,12 @@ class OldChangesList extends ChangesList {
 
        /**
         * @param RecentChange $rc
+        * @param string[] &$classes
         * @param boolean $watched
         *
         * @return string
         */
-       private function formatChangeLine( RecentChange $rc, $watched ) {
+       private function formatChangeLine( RecentChange $rc, array &$classes, $watched ) {
                $html = '';
 
                if ( $rc->mAttribs['rc_log_type'] ) {
index d009192..3a36b9f 100644 (file)
@@ -123,6 +123,17 @@ class OldChangesListTest extends MediaWikiLangTestCase {
                );
        }
 
+       public function testRecentChangesLine_Tags() {
+               $recentChange = $this->getEditChange();
+               $recentChange->mAttribs['ts_tags'] = 'vandalism,newbie';
+
+               $oldChangesList = $this->getOldChangesList();
+               $line = $oldChangesList->recentChangesLine( $recentChange, false, 1 );
+
+               $this->assertRegExp( '/<li class="[\w\s-]*mw-tag-vandalism[\w\s-]*">/', $line );
+               $this->assertRegExp( '/<li class="[\w\s-]*mw-tag-newbie[\w\s-]*">/', $line );
+       }
+
        private function getNewBotEditChange() {
                $user = $this->getTestUser();