26 parent::__construct( $name,
$data, $dataName );
35 'wgArticlePath' =>
'/wiki/$1'
38 $this->linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
43 $recentChange = $this->testRecentChangesHelper->makeEditRecentChange(
58 $cacheEntry = $cacheEntryFactory->newFromRecentChange( $recentChange,
false );
62 $this->
assertEquals(
false, $cacheEntry->watched,
'watched' );
63 $this->
assertEquals(
'21:21', $cacheEntry->timestamp,
'timestamp' );
64 $this->
assertEquals( 0, $cacheEntry->numberofWatchingusers,
'watching users' );
65 $this->
assertEquals(
false, $cacheEntry->unpatrolled,
'unpatrolled' );
70 $diff = [
'curid' => 5,
'diff' => 191,
'oldid' => 190 ];
71 $cur = [
'curid' => 5,
'diff' => 0,
'oldid' => 191 ];
79 $recentChange = $this->testRecentChangesHelper->makeLogRecentChange(
93 $cacheEntry = $cacheEntryFactory->newFromRecentChange( $recentChange,
false );
97 $this->
assertEquals(
false, $cacheEntry->watched,
'watched' );
98 $this->
assertEquals(
'21:21', $cacheEntry->timestamp,
'timestamp' );
99 $this->
assertEquals( 0, $cacheEntry->numberofWatchingusers,
'watching users' );
100 $this->
assertEquals(
false, $cacheEntry->unpatrolled,
'unpatrolled' );
105 $this->
assertEquals(
'cur', $cacheEntry->curlink,
'cur link for delete log or rev' );
106 $this->
assertEquals(
'diff', $cacheEntry->difflink,
'diff link for delete log or rev' );
107 $this->
assertEquals(
'prev', $cacheEntry->lastlink,
'pref link for delete log or rev' );
112 $recentChange = $this->testRecentChangesHelper->makeDeletedEditRecentChange(
127 $cacheEntry = $cacheEntryFactory->newFromRecentChange( $recentChange,
false );
131 $this->
assertEquals(
false, $cacheEntry->watched,
'watched' );
132 $this->
assertEquals(
'21:21', $cacheEntry->timestamp,
'timestamp' );
133 $this->
assertEquals( 0, $cacheEntry->numberofWatchingusers,
'watching users' );
134 $this->
assertEquals(
false, $cacheEntry->unpatrolled,
'unpatrolled' );
139 $this->
assertEquals(
'cur', $cacheEntry->curlink,
'cur link for delete log or rev' );
140 $this->
assertEquals(
'diff', $cacheEntry->difflink,
'diff link for delete log or rev' );
141 $this->
assertEquals(
'prev', $cacheEntry->lastlink,
'pref link for delete log or rev' );
146 $doc = PHPUnit_Util_XML::load( $actual,
true );
152 '#^<a .*class="new mw-userlink".*><bdi>' . $user .
'</bdi></a>#',
153 $cacheEntry->userlink,
159 '#^ <span class="mw-usertoollinks mw-changeslist-links">.*<span><a .+>talk</a></span>.*</span>#',
160 $cacheEntry->usertalklink,
161 'verify user talk link'
166 '#^ <span class="mw-usertoollinks mw-changeslist-links">.*<span><a .+>' .
167 'contribs</a></span>.*</span>$#',
168 $cacheEntry->usertalklink,
169 'verify user tool links'
175 '(<a href="/wiki/Special:Log/delete" title="Special:Log/delete">Deletion log</a>)',
177 'verify deletion log link'
185 ' <span class="history-deleted">(username removed)</span>',
186 $cacheEntry->userlink,
187 'verify user link for change with deleted revision and user'
194 '<a href="/wiki/' . $title .
'" title="' . $title .
'">' . $title .
'</a>',
203 "#^<a .+>$content</a>$#",
205 'verify query link element'
219 'enhancedrc-history' =>
'history',
221 'blocklink' =>
'block',
222 'history' =>
'Page history',
223 'semicolon-separator' =>
'; ',
224 'pipe-separator' =>
' | '
230 $context = $this->testRecentChangesHelper->getTestContext( $user );
232 $title = Title::newFromText(
'RecentChanges',
NS_SPECIAL );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
TestRecentChangesHelper $testRecentChangesHelper
__construct( $name=null, array $data=[], $dataName='')
testNewFromRecentChange()
assertDeleteLogLink( $cacheEntry)
assertUserLinks( $user, $cacheEntry)
LinkRenderer $linkRenderer
assertQueryLink( $content, $params, $link)
assertValidHTML( $actual)
assertTitleLink( $title, $cacheEntry)
testNewForRevUserDeleteChange()
assertRevDel( $cacheEntry)
Helper for generating test recent changes entries.
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
usually copyright or history_copyright This message must be in HTML not wikitext & $link
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))