$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,
$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()
// 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 );