From: jenkins-bot Date: Tue, 25 Jul 2017 23:47:48 +0000 (+0000) Subject: Merge "parserTests: Use "fallback" skin unless otherwise specified" X-Git-Tag: 1.31.0-rc.0~2591 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=3aa1cd89d574283c5749710d7b80182d056ae146;hp=-c;p=lhc%2Fweb%2Fwiklou.git Merge "parserTests: Use "fallback" skin unless otherwise specified" --- 3aa1cd89d574283c5749710d7b80182d056ae146 diff --combined tests/parser/ParserTestRunner.php index 8615edcd37,fff1eec78e..feed77fafd --- a/tests/parser/ParserTestRunner.php +++ b/tests/parser/ParserTestRunner.php @@@ -168,7 -168,7 +168,7 @@@ class ParserTestRunner global $wgParserTestFiles; // Add core test files - $files = array_map( function( $item ) { + $files = array_map( function ( $item ) { return __DIR__ . "/$item"; }, self::$coreTestFiles ); @@@ -1036,6 -1036,9 +1036,9 @@@ $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 +1108,13 @@@ $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 +1123,8 @@@ // 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 );