MediaWiki REL1_33
SpecialPageFatalTest.php
Go to the documentation of this file.
1<?php
2
4
17 public function provideSpecialPages() {
18 $specialPages = [];
19 $spf = MediaWikiServices::getInstance()->getSpecialPageFactory();
20 foreach ( $spf->getNames() as $name ) {
21 $specialPages[$name] = [ $spf->getPage( $name ) ];
22 }
23 return $specialPages;
24 }
25
29 public function testSpecialPageDoesNotFatal( SpecialPage $page ) {
30 $executor = new SpecialPageExecutor();
31 $user = User::newFromName( 'UTSysop' );
32
33 try {
34 $executor->executeSpecialPage( $page, '', null, null, $user );
35 } catch ( \PHPUnit\Framework\Error\Error $error ) {
36 // Let phpunit settings working:
37 // - convertErrorsToExceptions="true"
38 // - convertNoticesToExceptions="true"
39 // - convertWarningsToExceptions="true"
40 throw $error;
41 } catch ( Exception $e ) {
42 // Other exceptions are allowed
43 }
44
45 // If the page fataled phpunit will have already died
46 $this->addToAssertionCount( 1 );
47 }
48
49}
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
MediaWikiServices is the service locator for the application scope of MediaWiki.
Test that runs against all registered special pages to make sure that regular execution of the specia...
testSpecialPageDoesNotFatal(SpecialPage $page)
provideSpecialPages
Parent class for all special pages.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Definition User.php:585
Allows to change the fields on the form that will be generated $name
Definition hooks.txt:271
returning false will NOT prevent logging $e
Definition hooks.txt:2175