X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fparser%2FParserOutputTest.php;h=efcc4e079e4ea55b2a11c1bde77ac95163a9788b;hp=9642bbc0fb35cf1cf183fd6b658b3ee51977e81e;hb=74426f3cf796b149f1ae445e41815bbe148640b2;hpb=255d76f2a13a8378ded9f0cf1c2bb172f7f07a5b diff --git a/tests/phpunit/includes/parser/ParserOutputTest.php b/tests/phpunit/includes/parser/ParserOutputTest.php index 9642bbc0fb..efcc4e079e 100644 --- a/tests/phpunit/includes/parser/ParserOutputTest.php +++ b/tests/phpunit/includes/parser/ParserOutputTest.php @@ -105,6 +105,8 @@ class ParserOutputTest extends MediaWikiTestCase { 'wgScriptPath' => '/w', 'wgScript' => '/w/index.php', ] ); + $this->hideDeprecated( 'ParserOutput stateful allowTOC' ); + $this->hideDeprecated( 'ParserOutput stateful enableSectionEditLinks' ); $po = new ParserOutput( $text ); @@ -125,7 +127,7 @@ class ParserOutputTest extends MediaWikiTestCase { public static function provideGetText() { // phpcs:disable Generic.Files.LineLength $text = <<Test document. +

Test document.

Contents

    @@ -150,13 +152,13 @@ class ParserOutputTest extends MediaWikiTestCase {

    Section 3Section 3

    Three -

    +

EOF; return [ 'No stateless options, default state' => [ [], [], $text, <<Test document. +

Test document.

Contents

    @@ -181,12 +183,12 @@ EOF;

    Section 3[edit]

    Three -

    +

EOF ], 'No stateless options, TOC statefully disabled' => [ [], [ 'mTOCEnabled' => false ], $text, <<Test document. +

Test document.

Section 1[edit]

@@ -200,12 +202,12 @@ EOF

Section 3[edit]

Three -

+

EOF ], 'No stateless options, section edits statefully disabled' => [ [], [ 'mEditSectionTokens' => false ], $text, <<Test document. +

Test document.

Contents

    @@ -230,14 +232,14 @@ EOF

    Section 3

    Three -

    +

EOF ], 'Stateless options override stateful settings' => [ [ 'allowTOC' => true, 'enableSectionEditLinks' => true ], [ 'mTOCEnabled' => false, 'mEditSectionTokens' => false ], $text, <<Test document. +

Test document.

Contents

    @@ -262,12 +264,12 @@ EOF

    Section 3[edit]

    Three -

    +

EOF ], 'Statelessly disable section edit links' => [ [ 'enableSectionEditLinks' => false ], [], $text, <<Test document. +

Test document.

Contents

    @@ -292,13 +294,43 @@ EOF

    Section 3

    Three -

    +

EOF ], 'Statelessly disable TOC' => [ [ 'allowTOC' => false ], [], $text, <<

Test document. +

+ +

Section 1[edit]

+

One +

+

Section 2[edit]

+

Two +

+

Section 2.1[edit]

+

Two point one +

+

Section 3[edit]

+

Three +

+EOF + ], + 'Statelessly unwrap text' => [ + [ 'unwrap' => true ], [], $text, <<Test document.

+

Section 1[edit]

One @@ -314,6 +346,9 @@ EOF

EOF ], + 'Unwrap without a mw-parser-output wrapper' => [ + [ 'unwrap' => true ], [], '
Content
', '
Content
' + ], ]; // phpcs:enable }