getSpecialPageFactory(); foreach ( $spf->getNames() as $name ) { $specialPages[$name] = [ $spf->getPage( $name ) ]; } return $specialPages; } /** * @dataProvider provideSpecialPages */ public function testSpecialPageDoesNotFatal( SpecialPage $page ) { $executor = new SpecialPageExecutor(); $user = User::newFromName( 'UTSysop' ); try { $executor->executeSpecialPage( $page, '', null, 'qqx', $user ); } catch ( \PHPUnit\Framework\Error\Deprecated $deprecated ) { // Allow deprecation, // this test want to check fatals or other things breaking the extension } catch ( \PHPUnit\Framework\Error\Error $error ) { // Let phpunit settings working: // - convertErrorsToExceptions="true" // - convertNoticesToExceptions="true" // - convertWarningsToExceptions="true" throw $error; } catch ( Exception $e ) { // Other exceptions are allowed } // If the page fataled phpunit will have already died $this->addToAssertionCount( 1 ); } }