X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fparser%2FParserOutputTest.php;h=1f3ee67433c70685bd71818faa35477baaa2237c;hb=08b2cf66387856c623ff99bca4a83db2b7d8c9e6;hp=9642bbc0fb35cf1cf183fd6b658b3ee51977e81e;hpb=07a791ffd1d80c6a8f2ca4dfdbc3f2002ac869fe;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/parser/ParserOutputTest.php b/tests/phpunit/includes/parser/ParserOutputTest.php index 9642bbc0fb..1f3ee67433 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,14 @@ EOF

EOF ], + 'Unwrap without a mw-parser-output wrapper' => [ + [ 'unwrap' => true ], [], '
Content
', '
Content
' + ], + 'Unwrap with extra comment at end' => [ + [ 'unwrap' => true ], [], '

Test document.

+', '

Test document.

+' + ], ]; // phpcs:enable }