21 public function __construct( $name =
null, array $data = [], $dataName =
'' ) {
22 parent::__construct( $name, $data, $dataName );
31 'wgArticlePath' =>
'/wiki/$1',
43 $line = $oldChangesList->recentChangesLine( $recentChange,
false, $linenumber );
45 $this->assertRegExp( $expected,
$line, $message );
50 [
'/mw-line-odd/', 1,
'odd line number' ],
51 [
'/mw-line-even/', 2,
'even line number' ]
59 $line = $oldChangesList->recentChangesLine( $recentChange,
false, 1 );
61 $this->assertRegExp(
'/mw-changeslist-line-not-watched/',
$line );
68 $line = $oldChangesList->recentChangesLine( $recentChange,
true, 1 );
70 $this->assertRegExp(
'/mw-changeslist-line-watched/',
$line );
75 $recentChange = $this->
getLogChange(
'delete',
'delete' );
77 $line = $oldChangesList->recentChangesLine( $recentChange,
false, 1 );
79 $this->assertRegExp(
'/href="\/wiki\/Special:Log\/delete/',
$line,
'link has href attribute' );
80 $this->assertRegExp(
'/title="Special:Log\/delete/',
$line,
'link has title attribute' );
81 $this->assertRegExp(
"/dellogpage/",
$line,
'link text' );
88 $line = $oldChangesList->recentChangesLine( $recentChange,
false, 1 );
91 '/title=Cat&curid=20131103212153&diff=5&oldid=191/',
97 '/title=Cat&curid=20131103212153&action=history"/',
107 $line = $oldChangesList->recentChangesLine( $recentChange,
false, 1 );
109 $this->assertContains(
110 '<abbr class="newpage" title="(recentchanges-label-newpage)">(newpageletter)</abbr>',
115 $this->assertContains(
116 '<abbr class="botedit" title="(recentchanges-label-bot)">(boteditletter)</abbr>',
124 $recentChange->mAttribs[
'ts_tags'] =
'vandalism,newbie';
127 $line = $oldChangesList->recentChangesLine( $recentChange,
false, 1 );
130 '/<li data-mw-revid="\d+" data-mw-ts="\d+" class="[\w\s-]*mw-tag-vandalism[\w\s-]*">/',
134 '/<li data-mw-revid="\d+" data-mw-ts="\d+" class="[\w\s-]*mw-tag-newbie[\w\s-]*">/',
143 $recentChange->numberofWatchingusers = 100;
145 $line = $oldChangesList->recentChangesLine( $recentChange,
false, 1 );
146 $this->assertRegExp(
"/(number_of_watching_users_RCview: 100)/",
$line );
151 $oldChangesList->setWatchlistDivs(
true );
154 $line = $oldChangesList->recentChangesLine( $recentChange,
false, 1 );
155 $this->assertRegExp(
"/watchlist-0-Cat/",
$line );
160 $oldChangesList->setWatchlistDivs(
true );
163 $line = $oldChangesList->recentChangesLine( $recentChange,
false, 1 );
164 $this->assertRegExp(
'/data-target-page=\"Cat\"/',
$line );
166 $recentChange = $this->
getLogChange(
'delete',
'delete' );
167 $line = $oldChangesList->recentChangesLine( $recentChange,
false, 1 );
168 $this->assertRegExp(
'/data-target-page="Abc"/',
$line );
172 $mockContext = $this->getMockBuilder( RequestContext::class )
173 ->setMethods( [
'getTitle' ] )
175 $mockContext->method(
'getTitle' )
176 ->will( $this->returnValue( Title::newFromText(
'Expected Context Title' ) ) );
179 $oldChangesList->setContext( $mockContext );
182 $oldChangesList->setChangeLinePrefixer(
function ( $rc,
$changesList ) {
184 $this->assertEquals(
'Expected Context Title',
$changesList->getContext()->getTitle() );
185 $this->assertEquals(
'Cat', $rc->getTitle() );
186 return 'I am a prefix';
188 $line = $oldChangesList->recentChangesLine( $recentChange );
189 $this->assertRegExp(
"/I am a prefix/",
$line );
195 $recentChange = $this->testRecentChangesHelper->makeNewBotEditRecentChange(
196 $user,
'Abc',
'20131103212153', 5, 191, 190, 0, 0
199 return $recentChange;
205 $recentChange = $this->testRecentChangesHelper->makeLogRecentChange(
206 $logType, $logAction, $user,
'Abc',
'20131103212153', 0, 0
209 return $recentChange;
214 $recentChange = $this->testRecentChangesHelper->makeEditRecentChange(
215 $user,
'Cat',
'20131103212153', 5, 191, 190, 0, 0
218 return $recentChange;
228 $context = $this->testRecentChangesHelper->getTestContext( $user );
testRecentChangesLine_watchlistCssClass()
recentChangesLine_CssForLineNumberProvider()
getLogChange( $logType, $logAction)
testRecentChangesLine_CssForLineNumber( $expected, $linenumber, $message)
recentChangesLine_CssForLineNumberProvider
testRecentChangesLine_NotWatchedCssClass()
testRecentChangesLine_numberOfWatchingUsers()
testRecentChangesLine_dataAttribute()
TestRecentChangesHelper $testRecentChangesHelper
testRecentChangesLine_prefix()
testRecentChangesLine_Attribs()
testRecentChangesLine_WatchedCssClass()
testRecentChangesLine_DiffHistLinks()
__construct( $name=null, array $data=[], $dataName='')
testRecentChangesLine_LogTitle()
testRecentChangesLine_Flags()
Helper for generating test recent changes entries.
return true to allow those checks to and false if checking is done remove or add to the links of a group of changes in EnhancedChangesList Hook subscribers can return false to omit this line from recentchanges $changesList
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context