$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-' .
/**
* @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'] ) {
);
}
+ 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();