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 );
60 $this->assertInstanceOf( RCCacheEntry::class, $cacheEntry );
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 );
95 $this->assertInstanceOf( RCCacheEntry::class, $cacheEntry );
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 );
129 $this->assertInstanceOf( RCCacheEntry::class, $cacheEntry );
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">\(.*<a .+>talk</a>.*\)</span>#',
160 $cacheEntry->usertalklink,
161 'verify user talk link'
166 '#^ <span class="mw-usertoollinks">\(.*<a .+>contribs</a>.*\)</span>$#',
167 $cacheEntry->usertalklink,
168 'verify user tool links'
174 '(<a href="/wiki/Special:Log/delete" title="Special:Log/delete">Deletion log</a>)',
176 'verify deletion log link'
184 ' <span class="history-deleted">(username removed)</span>',
185 $cacheEntry->userlink,
186 'verify user link for change with deleted revision and user'
202 "#^<a .+>$content</a>$#",
204 'verify query link element'
209 $this->assertRegExp(
'/' . $key .
'=' .
$value .
'/',
$link,
"verify $key link params" );
218 'enhancedrc-history' =>
'history',
220 'blocklink' =>
'block',
221 'history' =>
'Page history',
222 'semicolon-separator' =>
'; ',
223 'pipe-separator' =>
' | '
229 $context = $this->testRecentChangesHelper->getTestContext(
$user );
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
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.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
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
namespace and then decline to actually register it file or subcat img or subcat $title
usually copyright or history_copyright This message must be in HTML not wikitext & $link
Allows to change the fields on the form that will be generated $name
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
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))