X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fparser%2FSanitizerTest.php;h=ad8aa1e7ebc9ebab44aa0cfa70eed23eba24677c;hb=6db35b3c98ee807c71d8187ea45d69999df63b38;hp=6590338d36ba5a21205ba941ba8e91ac12a06189;hpb=3f59cb9f3a53ad28f8a95fe299c5de6abd24b453;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/parser/SanitizerTest.php b/tests/phpunit/includes/parser/SanitizerTest.php index 6590338d36..ad8aa1e7eb 100644 --- a/tests/phpunit/includes/parser/SanitizerTest.php +++ b/tests/phpunit/includes/parser/SanitizerTest.php @@ -100,6 +100,8 @@ class SanitizerTest extends MediaWikiTestCase { * @param bool $escaped Whether sanitizer let the tag in or escape it (ie: '<video>') */ public function testRemovehtmltagsOnHtml5Tags( $tag, $escaped ) { + $this->hideDeprecated( 'disabling tidy' ); + $this->hideDeprecated( 'MWTidy::setInstance' ); MWTidy::setInstance( false ); if ( $escaped ) { @@ -162,6 +164,8 @@ class SanitizerTest extends MediaWikiTestCase { * @covers Sanitizer::removeHTMLtags */ public function testRemoveHTMLtags( $input, $output, $msg = null ) { + $this->hideDeprecated( 'disabling tidy' ); + $this->hideDeprecated( 'MWTidy::setInstance' ); MWTidy::setInstance( false ); $this->assertEquals( $output, Sanitizer::removeHTMLtags( $input ), $msg ); } @@ -457,7 +461,6 @@ class SanitizerTest extends MediaWikiTestCase { $legacyEncoded = 'foo_.D1.82.D0.B5.D1.81.D1.82_.23.25.21.27.28.29.5B.5D:.3C.3E' . '.26.26amp.3B.26amp.3Bamp.3B'; $html5Encoded = 'foo_тест_#%!\'()[]:<>&&&amp;'; - $html5Experimental = 'foo_тест_!_()[]:<>_amp;_amp;amp;'; // Settings: last element is $wgExternalInterwikiFragmentMode, the rest is $wgFragmentMode $legacy = [ 'legacy', 'legacy' ]; @@ -465,8 +468,6 @@ class SanitizerTest extends MediaWikiTestCase { $newLegacy = [ 'html5', 'legacy', 'legacy' ]; $new = [ 'html5', 'legacy' ]; $allNew = [ 'html5', 'html5' ]; - $experimentalLegacy = [ 'html5-legacy', 'legacy', 'legacy' ]; - $newExperimental = [ 'html5', 'html5-legacy', 'legacy' ]; return [ // Pure legacy: how MW worked before 2017 @@ -498,18 +499,6 @@ class SanitizerTest extends MediaWikiTestCase { [ 'Attribute', $allNew, $text, false, Sanitizer::ID_FALLBACK ], [ 'Link', $allNew, $text, $html5Encoded ], [ 'ExternalInterwiki', $allNew, $text, $html5Encoded ], - - // Someone flipped $wgExperimentalHtmlIds on - [ 'Attribute', $experimentalLegacy, $text, $html5Experimental, Sanitizer::ID_PRIMARY ], - [ 'Attribute', $experimentalLegacy, $text, $legacyEncoded, Sanitizer::ID_FALLBACK ], - [ 'Link', $experimentalLegacy, $text, $html5Experimental ], - [ 'ExternalInterwiki', $experimentalLegacy, $text, $legacyEncoded ], - - // Migration from $wgExperimentalHtmlIds to modern HTML5 - [ 'Attribute', $newExperimental, $text, $html5Encoded, Sanitizer::ID_PRIMARY ], - [ 'Attribute', $newExperimental, $text, $html5Experimental, Sanitizer::ID_FALLBACK ], - [ 'Link', $newExperimental, $text, $html5Encoded ], - [ 'ExternalInterwiki', $newExperimental, $text, $legacyEncoded ], ]; } @@ -529,7 +518,7 @@ class SanitizerTest extends MediaWikiTestCase { public function provideStripAllTags() { return [ [ '

Foo

', 'Foo' ], - [ '

Foo

Bar

', 'FooBar' ], + [ '

Foo

Bar

', 'Foo Bar' ], [ "

Foo

\n

Bar

", 'Foo Bar' ], [ '

Hello <strong> world café

', 'Hello world café' ], [