'initQUnitTesting', ); public function __construct() { parent::__construct( 'JavaScriptTest' ); } public function execute( $par ) { global $wgEnableJavaScriptTest; $out = $this->getOutput(); $this->setHeaders(); $out->disallowUserJs(); // Abort early if we're disabled if ( $wgEnableJavaScriptTest !== true ) { $out->addWikiMsg( 'javascripttest-disabled' ); return; } $out->addModules( 'mediawiki.special.javaScriptTest' ); // Determine framework $pars = explode( '/', $par ); $framework = strtolower( $pars[0] ); // No framework specified if ( $par == '' ) { $out->setPagetitle( wfMsgHtml( 'javascripttest' ) ); $summary = $this->wrapSummaryHtml( wfMsgHtml( 'javascripttest-pagetext-noframework' ) . $this->getFrameworkListHtml(), 'noframework' ); $out->addHtml( $summary ); // Matched! Display proper title and initialize the framework } elseif ( isset( self::$frameworks[$framework] ) ) { $out->setPagetitle( wfMsgHtml( 'javascripttest-title', wfMsgHtml( "javascripttest-$framework-name" ) ) ); $out->setSubtitle( wfMessage( 'javascripttest-backlink' )->rawParams( Linker::linkKnown( $this->getTitle() ) )->escaped() ); $this->{self::$frameworks[$framework]}(); // Framework not found, display error } else { $out->setPagetitle( wfMsgHtml( 'javascripttest' ) ); $summary = $this->wrapSummaryHtml( '
' . wfMsgHtml( 'javascripttest-pagetext-unknownframework', $par ) . '
' . $this->getFrameworkListHtml(), 'unknownframework' ); $out->addHtml( $summary ); } } /** * Get a list of frameworks (including introduction paragraph and links to the framework run pages) * @return String: HTML */ private function getFrameworkListHtml() { $list = '