MediaWiki  master
SpecialBlockTest.php
Go to the documentation of this file.
1 <?php
2 
9 
19  protected function newSpecialPage() {
20  return new SpecialBlock();
21  }
22 
23  public function tearDown() {
24  parent::tearDown();
25  $this->resetTables();
26  }
27 
31  public function testGetFormFields() {
32  $this->setMwGlobals( [
33  'wgEnablePartialBlocks' => false,
34  'wgBlockAllowsUTEdit' => true,
35  ] );
36  $page = $this->newSpecialPage();
37  $wrappedPage = TestingAccessWrapper::newFromObject( $page );
38  $fields = $wrappedPage->getFormFields();
39  $this->assertInternalType( 'array', $fields );
40  $this->assertArrayHasKey( 'Target', $fields );
41  $this->assertArrayHasKey( 'Expiry', $fields );
42  $this->assertArrayHasKey( 'Reason', $fields );
43  $this->assertArrayHasKey( 'CreateAccount', $fields );
44  $this->assertArrayHasKey( 'DisableUTEdit', $fields );
45  $this->assertArrayHasKey( 'AutoBlock', $fields );
46  $this->assertArrayHasKey( 'HardBlock', $fields );
47  $this->assertArrayHasKey( 'PreviousTarget', $fields );
48  $this->assertArrayHasKey( 'Confirm', $fields );
49 
50  $this->assertArrayNotHasKey( 'EditingRestriction', $fields );
51  $this->assertArrayNotHasKey( 'PageRestrictions', $fields );
52  $this->assertArrayNotHasKey( 'NamespaceRestrictions', $fields );
53  }
54 
58  public function testGetFormFieldsPartialBlocks() {
59  $this->setMwGlobals( [
60  'wgEnablePartialBlocks' => true,
61  ] );
62  $page = $this->newSpecialPage();
63  $wrappedPage = TestingAccessWrapper::newFromObject( $page );
64  $fields = $wrappedPage->getFormFields();
65 
66  $this->assertArrayHasKey( 'EditingRestriction', $fields );
67  $this->assertArrayHasKey( 'PageRestrictions', $fields );
68  $this->assertArrayHasKey( 'NamespaceRestrictions', $fields );
69  }
70 
74  public function testMaybeAlterFormDefaults() {
75  $this->setMwGlobals( [
76  'wgEnablePartialBlocks' => false,
77  'wgBlockAllowsUTEdit' => true,
78  ] );
79 
80  $block = $this->insertBlock();
81 
82  // Refresh the block from the database.
83  $block = DatabaseBlock::newFromTarget( $block->getTarget() );
84 
85  $page = $this->newSpecialPage();
86 
87  $wrappedPage = TestingAccessWrapper::newFromObject( $page );
88  $wrappedPage->target = $block->getTarget();
89  $fields = $wrappedPage->getFormFields();
90 
91  $this->assertSame( (string)$block->getTarget(), $fields['Target']['default'] );
92  $this->assertSame( $block->isHardblock(), $fields['HardBlock']['default'] );
93  $this->assertSame( $block->isCreateAccountBlocked(), $fields['CreateAccount']['default'] );
94  $this->assertSame( $block->isAutoblocking(), $fields['AutoBlock']['default'] );
95  $this->assertSame( !$block->isUsertalkEditAllowed(), $fields['DisableUTEdit']['default'] );
96  $this->assertSame( $block->getReason(), $fields['Reason']['default'] );
97  $this->assertSame( 'infinite', $fields['Expiry']['default'] );
98  }
99 
104  $this->setMwGlobals( [
105  'wgEnablePartialBlocks' => true,
106  ] );
107 
108  $badActor = $this->getTestUser()->getUser();
109  $sysop = $this->getTestSysop()->getUser();
110  $pageSaturn = $this->getExistingTestPage( 'Saturn' );
111  $pageMars = $this->getExistingTestPage( 'Mars' );
112 
113  $block = new DatabaseBlock( [
114  'address' => $badActor->getName(),
115  'user' => $badActor->getId(),
116  'by' => $sysop->getId(),
117  'expiry' => 'infinity',
118  'sitewide' => 0,
119  'enableAutoblock' => true,
120  ] );
121 
122  $block->setRestrictions( [
123  new PageRestriction( 0, $pageSaturn->getId() ),
124  new PageRestriction( 0, $pageMars->getId() ),
125  new NamespaceRestriction( 0, NS_TALK ),
126  // Deleted page.
127  new PageRestriction( 0, 999999 ),
128  ] );
129 
130  $block->insert();
131 
132  // Refresh the block from the database.
133  $block = DatabaseBlock::newFromTarget( $block->getTarget() );
134 
135  $page = $this->newSpecialPage();
136 
137  $wrappedPage = TestingAccessWrapper::newFromObject( $page );
138  $wrappedPage->target = $block->getTarget();
139  $fields = $wrappedPage->getFormFields();
140 
141  $titles = [
142  $pageMars->getTitle()->getPrefixedText(),
143  $pageSaturn->getTitle()->getPrefixedText(),
144  ];
145 
146  $this->assertSame( (string)$block->getTarget(), $fields['Target']['default'] );
147  $this->assertSame( 'partial', $fields['EditingRestriction']['default'] );
148  $this->assertSame( implode( "\n", $titles ), $fields['PageRestrictions']['default'] );
149  }
150 
154  public function testProcessForm() {
155  $this->setMwGlobals( [
156  'wgEnablePartialBlocks' => false,
157  ] );
158  $badActor = $this->getTestUser()->getUser();
160 
161  $page = $this->newSpecialPage();
162  $reason = 'test';
163  $expiry = 'infinity';
164  $data = [
165  'Target' => (string)$badActor,
166  'Expiry' => 'infinity',
167  'Reason' => [
168  $reason,
169  ],
170  'Confirm' => '1',
171  'CreateAccount' => '0',
172  'DisableUTEdit' => '0',
173  'DisableEmail' => '0',
174  'HardBlock' => '0',
175  'AutoBlock' => '1',
176  'HideUser' => '0',
177  'Watch' => '0',
178  ];
179  $result = $page->processForm( $data, $context );
180 
181  $this->assertTrue( $result );
182 
183  $block = DatabaseBlock::newFromTarget( $badActor );
184  $this->assertSame( $reason, $block->getReason() );
185  $this->assertSame( $expiry, $block->getExpiry() );
186  }
187 
191  public function testProcessFormExisting() {
192  $this->setMwGlobals( [
193  'wgEnablePartialBlocks' => false,
194  ] );
195  $badActor = $this->getTestUser()->getUser();
196  $sysop = $this->getTestSysop()->getUser();
198 
199  // Create a block that will be updated.
200  $block = new DatabaseBlock( [
201  'address' => $badActor->getName(),
202  'user' => $badActor->getId(),
203  'by' => $sysop->getId(),
204  'expiry' => 'infinity',
205  'sitewide' => 0,
206  'enableAutoblock' => false,
207  ] );
208  $block->insert();
209 
210  $page = $this->newSpecialPage();
211  $reason = 'test';
212  $expiry = 'infinity';
213  $data = [
214  'Target' => (string)$badActor,
215  'Expiry' => 'infinity',
216  'Reason' => [
217  $reason,
218  ],
219  'Confirm' => '1',
220  'CreateAccount' => '0',
221  'DisableUTEdit' => '0',
222  'DisableEmail' => '0',
223  'HardBlock' => '0',
224  'AutoBlock' => '1',
225  'HideUser' => '0',
226  'Watch' => '0',
227  ];
228  $result = $page->processForm( $data, $context );
229 
230  $this->assertTrue( $result );
231 
232  $block = DatabaseBlock::newFromTarget( $badActor );
233  $this->assertSame( $reason, $block->getReason() );
234  $this->assertSame( $expiry, $block->getExpiry() );
235  $this->assertSame( '1', $block->isAutoblocking() );
236  }
237 
241  public function testProcessFormRestrictions() {
242  $this->setMwGlobals( [
243  'wgEnablePartialBlocks' => true,
244  ] );
245  $badActor = $this->getTestUser()->getUser();
247 
248  $pageSaturn = $this->getExistingTestPage( 'Saturn' );
249  $pageMars = $this->getExistingTestPage( 'Mars' );
250 
251  $titles = [
252  $pageSaturn->getTitle()->getText(),
253  $pageMars->getTitle()->getText(),
254  ];
255 
256  $page = $this->newSpecialPage();
257  $reason = 'test';
258  $expiry = 'infinity';
259  $data = [
260  'Target' => (string)$badActor,
261  'Expiry' => 'infinity',
262  'Reason' => [
263  $reason,
264  ],
265  'Confirm' => '1',
266  'CreateAccount' => '0',
267  'DisableUTEdit' => '0',
268  'DisableEmail' => '0',
269  'HardBlock' => '0',
270  'AutoBlock' => '1',
271  'HideUser' => '0',
272  'Watch' => '0',
273  'EditingRestriction' => 'partial',
274  'PageRestrictions' => implode( "\n", $titles ),
275  'NamespaceRestrictions' => '',
276  ];
277  $result = $page->processForm( $data, $context );
278 
279  $this->assertTrue( $result );
280 
281  $block = DatabaseBlock::newFromTarget( $badActor );
282  $this->assertSame( $reason, $block->getReason() );
283  $this->assertSame( $expiry, $block->getExpiry() );
284  $this->assertCount( 2, $block->getRestrictions() );
285  $this->assertTrue( $this->getBlockRestrictionStore()->equals( $block->getRestrictions(), [
286  new PageRestriction( $block->getId(), $pageMars->getId() ),
287  new PageRestriction( $block->getId(), $pageSaturn->getId() ),
288  ] ) );
289  }
290 
295  $this->setMwGlobals( [
296  'wgEnablePartialBlocks' => true,
297  ] );
298  $badActor = $this->getTestUser()->getUser();
300 
301  $pageSaturn = $this->getExistingTestPage( 'Saturn' );
302  $pageMars = $this->getExistingTestPage( 'Mars' );
303 
304  $titles = [
305  $pageSaturn->getTitle()->getText(),
306  $pageMars->getTitle()->getText(),
307  ];
308 
309  // Create a partial block.
310  $page = $this->newSpecialPage();
311  $reason = 'test';
312  $expiry = 'infinity';
313  $data = [
314  'Target' => (string)$badActor,
315  'Expiry' => 'infinity',
316  'Reason' => [
317  $reason,
318  ],
319  'Confirm' => '1',
320  'CreateAccount' => '0',
321  'DisableUTEdit' => '0',
322  'DisableEmail' => '0',
323  'HardBlock' => '0',
324  'AutoBlock' => '1',
325  'HideUser' => '0',
326  'Watch' => '0',
327  'EditingRestriction' => 'partial',
328  'PageRestrictions' => implode( "\n", $titles ),
329  'NamespaceRestrictions' => '',
330  ];
331  $result = $page->processForm( $data, $context );
332 
333  $this->assertTrue( $result );
334 
335  $block = DatabaseBlock::newFromTarget( $badActor );
336  $this->assertSame( $reason, $block->getReason() );
337  $this->assertSame( $expiry, $block->getExpiry() );
338  $this->assertFalse( $block->isSitewide() );
339  $this->assertCount( 2, $block->getRestrictions() );
340  $this->assertTrue( $this->getBlockRestrictionStore()->equals( $block->getRestrictions(), [
341  new PageRestriction( $block->getId(), $pageMars->getId() ),
342  new PageRestriction( $block->getId(), $pageSaturn->getId() ),
343  ] ) );
344 
345  // Remove a page from the partial block.
346  $data['PageRestrictions'] = $pageMars->getTitle()->getText();
347  $result = $page->processForm( $data, $context );
348 
349  $this->assertTrue( $result );
350 
351  $block = DatabaseBlock::newFromTarget( $badActor );
352  $this->assertSame( $reason, $block->getReason() );
353  $this->assertSame( $expiry, $block->getExpiry() );
354  $this->assertFalse( $block->isSitewide() );
355  $this->assertCount( 1, $block->getRestrictions() );
356  $this->assertTrue( $this->getBlockRestrictionStore()->equals( $block->getRestrictions(), [
357  new PageRestriction( $block->getId(), $pageMars->getId() ),
358  ] ) );
359 
360  // Remove the last page from the block.
361  $data['PageRestrictions'] = '';
362  $result = $page->processForm( $data, $context );
363 
364  $this->assertTrue( $result );
365 
366  $block = DatabaseBlock::newFromTarget( $badActor );
367  $this->assertSame( $reason, $block->getReason() );
368  $this->assertSame( $expiry, $block->getExpiry() );
369  $this->assertFalse( $block->isSitewide() );
370  $this->assertCount( 0, $block->getRestrictions() );
371 
372  // Change to sitewide.
373  $data['EditingRestriction'] = 'sitewide';
374  $result = $page->processForm( $data, $context );
375 
376  $this->assertTrue( $result );
377 
378  $block = DatabaseBlock::newFromTarget( $badActor );
379  $this->assertSame( $reason, $block->getReason() );
380  $this->assertSame( $expiry, $block->getExpiry() );
381  $this->assertTrue( $block->isSitewide() );
382  $this->assertCount( 0, $block->getRestrictions() );
383 
384  // Ensure that there are no restrictions where the blockId is 0.
385  $count = $this->db->selectRowCount(
386  'ipblocks_restrictions',
387  '*',
388  [ 'ir_ipb_id' => 0 ],
389  __METHOD__
390  );
391  $this->assertSame( 0, $count );
392  }
393 
398  public function testCheckUnblockSelf(
399  $blockedUser,
400  $blockPerformer,
401  $adjustPerformer,
402  $adjustTarget,
403  $expectedResult,
404  $reason
405  ) {
406  $this->setMwGlobals( [
407  'wgBlockDisablesLogin' => false,
408  ] );
409  $this->setGroupPermissions( 'sysop', 'unblockself', true );
410  $this->setGroupPermissions( 'user', 'block', true );
411  // Getting errors about creating users in db in provider.
412  // Need to use mutable to ensure different named testusers.
413  $users = [
414  'u1' => TestUserRegistry::getMutableTestUser( __CLASS__, 'sysop' )->getUser(),
415  'u2' => TestUserRegistry::getMutableTestUser( __CLASS__, 'sysop' )->getUser(),
416  'u3' => TestUserRegistry::getMutableTestUser( __CLASS__, 'sysop' )->getUser(),
417  'u4' => TestUserRegistry::getMutableTestUser( __CLASS__, 'sysop' )->getUser(),
418  'nonsysop' => $this->getTestUser()->getUser()
419  ];
420  foreach ( [ 'blockedUser', 'blockPerformer', 'adjustPerformer', 'adjustTarget' ] as $var ) {
421  $$var = $users[$$var];
422  }
423 
424  $block = new DatabaseBlock( [
425  'address' => $blockedUser->getName(),
426  'user' => $blockedUser->getId(),
427  'by' => $blockPerformer->getId(),
428  'expiry' => 'infinity',
429  'sitewide' => 1,
430  'enableAutoblock' => true,
431  ] );
432 
433  $block->insert();
434 
435  $this->assertSame(
436  SpecialBlock::checkUnblockSelf( $adjustTarget, $adjustPerformer ),
437  $expectedResult,
438  $reason
439  );
440  }
441 
442  public function provideCheckUnblockSelf() {
443  // 'blockedUser', 'blockPerformer', 'adjustPerformer', 'adjustTarget'
444  return [
445  [ 'u1', 'u2', 'u3', 'u4', true, 'Unrelated users' ],
446  [ 'u1', 'u2', 'u1', 'u4', 'ipbblocked', 'Block unrelated while blocked' ],
447  [ 'u1', 'u2', 'u1', 'u1', true, 'Has unblockself' ],
448  [ 'nonsysop', 'u2', 'nonsysop', 'nonsysop', 'ipbnounblockself', 'no unblockself' ],
449  [ 'nonsysop', 'nonsysop', 'nonsysop', 'nonsysop', true, 'no unblockself but can de-selfblock' ],
450  [ 'u1', 'u2', 'u1', 'u2', true, 'Can block user who blocked' ],
451  ];
452  }
453 
454  protected function insertBlock() {
455  $badActor = $this->getTestUser()->getUser();
456  $sysop = $this->getTestSysop()->getUser();
457 
458  $block = new DatabaseBlock( [
459  'address' => $badActor->getName(),
460  'user' => $badActor->getId(),
461  'by' => $sysop->getId(),
462  'expiry' => 'infinity',
463  'sitewide' => 1,
464  'enableAutoblock' => true,
465  ] );
466 
467  $block->insert();
468 
469  return $block;
470  }
471 
472  protected function resetTables() {
473  $this->db->delete( 'ipblocks', '*', __METHOD__ );
474  $this->db->delete( 'ipblocks_restrictions', '*', __METHOD__ );
475  }
476 
483  $loadBalancer = $this->getMockBuilder( LoadBalancer::class )
484  ->disableOriginalConstructor()
485  ->getMock();
486 
487  return new BlockRestrictionStore( $loadBalancer );
488  }
489 }
A special page that allows users with &#39;block&#39; right to block users from editing pages and other actio...
static checkUnblockSelf( $target, User $performer)
T17810: blocked admins should not be able to block/unblock others, and probably shouldn&#39;t be able to ...
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible true was required This is the default since MediaWiki *some string
Definition: hooks.txt:175
A DatabaseBlock (unlike a SystemBlock) is stored in the database, may give rise to autoblocks and may...
testProcessFormExisting()
::processForm()
testGetFormFields()
::getFormFields()
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page. Return false to stop further processing of the tag $reader:XMLReader object & $pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUnknownUser':When a user doesn 't exist locally, this hook is called to give extensions an opportunity to auto-create it. If the auto-creation is successful, return false. $name:User name 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. & $fullInterwikiPrefix:Interwiki prefix, may contain colons. & $pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. & $importSources:The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. & $title:Title object for the current page & $request:WebRequest & $ignoreRedirect:boolean to skip redirect check & $target:Title/string of redirect target & $article:Article object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) & $article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Array with elements of the form "language:title" in the order that they will be output. & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED since 1.28! Use HtmlPageLinkRendererBegin instead. Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
Definition: hooks.txt:1980
insert( $dbw=null)
Insert a block into the block table.
static getTestSysop()
Convenience method for getting an immutable admin test user.
static getMain()
Get the RequestContext object associated with the main request.
setGroupPermissions( $newPerms, $newKey=null, $newValue=null)
Alters $wgGroupPermissions for the duration of the test.
setRestrictions(array $restrictions)
Set Restrictions.
testMaybeAlterFormDefaults()
::maybeAlterFormDefaults()
testMaybeAlterFormDefaultsPartial()
::maybeAlterFormDefaults()
static getMutableTestUser( $testName, $groups=[])
Get a TestUser object that the caller may modify.
testCheckUnblockSelf( $blockedUser, $blockPerformer, $adjustPerformer, $adjustTarget, $expectedResult, $reason)
provideCheckUnblockSelf ::checkUnblockSelf
setMwGlobals( $pairs, $value=null)
Sets a global, maintaining a stashed version of the previous global to be restored in tearDown...
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
Definition: distributors.txt:9
static TestUser [] $users
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
Definition: injection.txt:35
linkcache txt The LinkCache class maintains a list of article titles and the information about whether or not the article exists in the database This is used to mark up links when displaying a page If the same link appears more than once on any page then it only has to be looked up once In most cases link lookups are done in batches with the LinkBatch class or the equivalent in so the link cache is mostly useful for short snippets of parsed and for links in the navigation areas of the skin The link cache was formerly used to track links used in a document for the purposes of updating the link tables This application is now deprecated To create a you can use the following $titles
Definition: linkcache.txt:17
Blocking Database SpecialBlock.
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
Definition: maintenance.txt:52
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
Definition: hooks.txt:2633
testProcessFormRestrictionsChange()
::processForm()
testProcessForm()
::processForm()
const NS_TALK
Definition: Defines.php:61
getExistingTestPage( $title=null)
Returns a WikiPage representing an existing page.
Base class for testing special pages.
testGetFormFieldsPartialBlocks()
::getFormFields()
getBlockRestrictionStore()
Get a BlockRestrictionStore instance.
testProcessFormRestrictions()
::processForm()
static getTestUser( $groups=[])
Convenience method for getting an immutable test user.