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', $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 ];
72 $this->
assertQueryLink(
'cur', $cur, $cacheEntry->curlink,
'cur link' );
73 $this->
assertQueryLink(
'prev', $diff, $cacheEntry->lastlink,
'prev link' );
74 $this->
assertQueryLink(
'diff', $diff, $cacheEntry->difflink,
'diff link' );
80 'user' =>
'TestRecentChangesUser',
81 'timestamp' =>
'21:21',
82 'numberofWatchingusers' => 0,
83 'unpatrolled' =>
false
86 $recentChange = $this->testRecentChangesHelper->makeLogRecentChange(
100 $cacheEntry = $cacheEntryFactory->newFromRecentChange( $recentChange,
false );
102 $this->assertInstanceOf(
'RCCacheEntry', $cacheEntry );
104 $this->assertEquals(
false, $cacheEntry->watched,
'watched' );
105 $this->assertEquals(
'21:21', $cacheEntry->timestamp,
'timestamp' );
106 $this->assertEquals( 0, $cacheEntry->numberofWatchingusers,
'watching users' );
107 $this->assertEquals(
false, $cacheEntry->unpatrolled,
'unpatrolled' );
112 $this->assertEquals(
'cur', $cacheEntry->curlink,
'cur link for delete log or rev' );
113 $this->assertEquals(
'diff', $cacheEntry->difflink,
'diff link for delete log or rev' );
114 $this->assertEquals(
'prev', $cacheEntry->lastlink,
'pref link for delete log or rev' );
119 $recentChange = $this->testRecentChangesHelper->makeDeletedEditRecentChange(
134 $cacheEntry = $cacheEntryFactory->newFromRecentChange( $recentChange,
false );
136 $this->assertInstanceOf(
'RCCacheEntry', $cacheEntry );
138 $this->assertEquals(
false, $cacheEntry->watched,
'watched' );
139 $this->assertEquals(
'21:21', $cacheEntry->timestamp,
'timestamp' );
140 $this->assertEquals( 0, $cacheEntry->numberofWatchingusers,
'watching users' );
141 $this->assertEquals(
false, $cacheEntry->unpatrolled,
'unpatrolled' );
146 $this->assertEquals(
'cur', $cacheEntry->curlink,
'cur link for delete log or rev' );
147 $this->assertEquals(
'diff', $cacheEntry->difflink,
'diff link for delete log or rev' );
148 $this->assertEquals(
'prev', $cacheEntry->lastlink,
'pref link for delete log or rev' );
156 'class' =>
'new mw-userlink'
160 $cacheEntry->userlink,
168 'class' =>
'mw-usertoollinks'
175 $cacheEntry->usertalklink,
176 'verify user talk link'
183 'class' =>
'mw-usertoollinks'
187 'content' =>
'contribs',
190 $cacheEntry->usertalklink,
191 'verify user tool links'
200 'href' =>
'/wiki/Special:Log/delete',
201 'title' =>
'Special:Log/delete'
203 'content' =>
'Deletion log'
206 'verify deletion log link'
215 'class' =>
'history-deleted'
217 'content' =>
'(username removed)'
219 $cacheEntry->userlink,
220 'verify user link for change with deleted revision and user'
229 'href' =>
'/wiki/' .
$title,
246 'assert query link element'
250 $this->assertRegExp(
'/' . $key .
'=' .
$value .
'/',
$link,
"verify $key link params" );
259 'enhancedrc-history' =>
'history',
261 'blocklink' =>
'block',
262 'history' =>
'Page history',
263 'semicolon-separator' =>
'; ',
264 'pipe-separator' =>
' | '
270 $context = $this->testRecentChangesHelper->getTestContext(
$user );
assertRevDel($cacheEntry)
the array() calling protocol came about after MediaWiki 1.4rc1.
processing should stop and the error should be shown to the user * false
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
Helper for generating test recent changes entries.
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 MediaWikiServices
static newFromText($text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
testNewForRevUserDeleteChange()
usually copyright or history_copyright This message must be in HTML not wikitext & $link
assertTitleLink($title, $cacheEntry)
TestRecentChangesHelper $testRecentChangesHelper
__construct($name=null, array $data=[], $dataName= '')
namespace and then decline to actually register it file or subcat img or subcat $title
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
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
assertQueryLink($content, $params, $link)
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
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content $content
testNewFromRecentChange()
assertUserLinks($user, $cacheEntry)
assertDeleteLogLink($cacheEntry)
Allows to change the fields on the form that will be generated $name