X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=blobdiff_plain;f=tests%2Fparser%2FParserTestRunner.php;h=feed77fafd7c7723aa0b8b758b6025b323d20b27;hb=3aa1cd89d574283c5749710d7b80182d056ae146;hp=8615edcd378fb3a2664cd6d52a37c2f483dd7f3c;hpb=baa5c190ea9a94d57038cd59611e8ef19a5bba78;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/parser/ParserTestRunner.php b/tests/parser/ParserTestRunner.php index 8615edcd37..feed77fafd 100644 --- a/tests/parser/ParserTestRunner.php +++ b/tests/parser/ParserTestRunner.php @@ -1036,6 +1036,9 @@ class ParserTestRunner { $linkHolderBatchSize = self::getOptionValue( 'wgLinkHolderBatchSize', $opts, 1000 ); + // Default to fallback skin, but allow it to be overridden + $skin = self::getOptionValue( 'skin', $opts, 'fallback' ); + $setup = [ 'wgEnableUploads' => self::getOptionValue( 'wgEnableUploads', $opts, true ), 'wgLanguageCode' => $langCode, @@ -1105,7 +1108,13 @@ class ParserTestRunner { $context = RequestContext::getMain(); $context->setUser( $user ); $context->setLanguage( $lang ); - $teardown[] = function () use ( $context ) { + // And the skin! + $oldSkin = $context->getSkin(); + $skinFactory = MediaWikiServices::getInstance()->getSkinFactory(); + $context->setSkin( $skinFactory->makeSkin( $skin ) ); + $context->setOutput( new OutputPage( $context ) ); + $setup['wgOut'] = $context->getOutput(); + $teardown[] = function () use ( $context, $oldSkin ) { // Clear language conversion tables $wrapper = TestingAccessWrapper::newFromObject( $context->getLanguage()->getConverter() @@ -1114,6 +1123,8 @@ class ParserTestRunner { // Reset context to the restored globals $context->setUser( $GLOBALS['wgUser'] ); $context->setLanguage( $GLOBALS['wgContLang'] ); + $context->setSkin( $oldSkin ); + $context->setOutput( $GLOBALS['wgOut'] ); }; $teardown[] = $this->executeSetupSnippets( $setup );