4 * Test that runs against all registered special pages to make sure that regular
5 * execution of the special page does not cause a fatal error.
7 * UTSysop is used to run as much of the special page code as possible without
8 * actually knowing the details of the special page.
13 class SpecialPageFatalTest
extends MediaWikiTestCase
{
15 public static function setUpBeforeClass() {
16 parent
::setUpBeforeClass();
17 self
::overrideMwServices();
20 public static function tearDownAfterClass() {
21 self
::overrideMwServices();
22 parent
::tearDownAfterClass();
25 public function provideSpecialPages() {
27 foreach ( SpecialPageFactory
::getNames() as $name ) {
28 $specialPages[$name] = [ SpecialPageFactory
::getPage( $name ) ];
34 * @dataProvider provideSpecialPages
36 public function testSpecialPageDoesNotFatal( SpecialPage
$page ) {
37 $executor = new SpecialPageExecutor();
38 $user = User
::newFromName( 'UTSysop' );
41 $executor->executeSpecialPage( $page, '', null, null, $user );
42 } catch ( Exception
$e ) {
43 // Exceptions are allowed
46 // If the page fataled phpunit will have already died
47 $this->addToAssertionCount( 1 );