X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fparser%2FParserOptionsTest.php;h=264e35d5a2c52f68fde7850e51a1e95f93e32380;hb=04d149b816c23b9a35db9e2258ee43eb04edd2d6;hp=d6061420e76bd4f54e6f6298f6d63fa0a7f82896;hpb=7f3d6713e7191c476adb3d3c30344a0327b853d3;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/parser/ParserOptionsTest.php b/tests/phpunit/includes/parser/ParserOptionsTest.php index d6061420e7..264e35d5a2 100644 --- a/tests/phpunit/includes/parser/ParserOptionsTest.php +++ b/tests/phpunit/includes/parser/ParserOptionsTest.php @@ -37,66 +37,6 @@ class ParserOptionsTest extends MediaWikiTestCase { ]; } - /** - * @dataProvider provideOptionsHashPre30 - * @param array $usedOptions Used options - * @param string $expect Expected value - * @param array $options Options to set - * @param array $globals Globals to set - */ - public function testOptionsHashPre30( $usedOptions, $expect, $options, $globals = [] ) { - global $wgHooks; - - $globals += [ - 'wgRenderHashAppend' => '', - 'wgHooks' => [], - ]; - $globals['wgHooks'] += [ - 'PageRenderingHash' => [], - ] + $wgHooks; - $this->setMwGlobals( $globals ); - - $popt = new ParserOptions(); - foreach ( $options as $setter => $value ) { - $popt->$setter( $value ); - } - $this->assertSame( $expect, $popt->optionsHashPre30( $usedOptions ) ); - } - - public static function provideOptionsHashPre30() { - $used = [ 'wrapclass', 'printable' ]; - - return [ - 'Canonical options, nothing used' => [ [], '*!*!*!*!*!*', [] ], - 'Canonical options, used some options' => [ $used, '*!*!*!*!*!*', [] ], - 'Used some options, non-default values' => [ - $used, - '*!*!*!*!*!*!printable=1!wrapclass=foobar', - [ - 'setWrapOutputClass' => 'foobar', - 'setIsPrintable' => true, - ] - ], - 'Canonical options, nothing used, but with hooks and $wgRenderHashAppend' => [ - [], - '*!*!*!*!*!wgRenderHashAppend!*!onPageRenderingHash', - [], - [ - 'wgRenderHashAppend' => '!wgRenderHashAppend', - 'wgHooks' => [ 'PageRenderingHash' => [ [ __CLASS__ . '::onPageRenderingHash' ] ] ], - ] - ], - - // Test weird historical behavior is still weird - 'Canonical options, editsection=true used' => [ [ 'editsection' ], '*!*!*!*!*', [ - 'setEditSection' => true, - ] ], - 'Canonical options, editsection=false used' => [ [ 'editsection' ], '*!*!*!*!*!edit=0', [ - 'setEditSection' => false, - ] ], - ]; - } - /** * @dataProvider provideOptionsHash * @param array $usedOptions Used options