overrideConfigValue( MainConfigNames::DefaultSkin, 'fallback' );
$this->clearHook( 'SkinEditSectionLinks' );
RequestContext::resetMain();
$this->overrideConfigValues( [
MainConfigNames::ScriptPath => '/w',
MainConfigNames::Script => '/w/index.php',
MainConfigNames::ParserEnableLegacyHeadingDOM => false,
] );
$po = new ParserOutput( $text );
TestUtils::initSections( $po );
$actual = $this->getServiceContainer()->getDefaultOutputPipeline()
->run( $po, null, $options )->getContentHolderText();
$this->assertSame( $expect, $actual );
}
public static function provideTransform() {
return [
'No options' => [
[], TestUtils::TEST_DOC, <<
One
Two
Two point one
Three
EOF ], 'Disable section edit links' => [ [ 'enableSectionEditLinks' => false ], TestUtils::TEST_DOC, <<One
Two
Two point one
Three
EOF ], 'Disable TOC, but wrap' => [ [ 'allowTOC' => false, 'wrapperDivClass' => 'mw-parser-output' ], TestUtils::TEST_DOC, <<Test document.
One
Two
Two point one
Three
EOF ], 'Style deduplication disabled' => [ [ 'deduplicateStyles' => false ], TestUtils::TEST_TO_DEDUP, TestUtils::TEST_TO_DEDUP ], ]; // phpcs:enable } /** * @covers \MediaWiki\OutputTransform\DefaultOutputPipelineFactory::buildPipeline */ public function testTransform_failsIfNoText() { $po = new ParserOutput( null ); $this->expectException( LogicException::class ); $this->getServiceContainer()->getDefaultOutputPipeline() ->run( $po, null, [] ); } }