Merge "Better logging for botpasswords"
[lhc/web/wiklou.git] / tests / phpunit / includes / parser / SanitizerTest.php
index 269575b..b5965c4 100644 (file)
@@ -406,6 +406,7 @@ class SanitizerTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provideIsReservedDataAttribute
+        * @covers Sanitizer::isReservedDataAttribute
         */
        public function testIsReservedDataAttribute( $attr, $expected ) {
                $this->assertSame( $expected, Sanitizer::isReservedDataAttribute( $attr ) );
@@ -456,7 +457,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;&amp;amp;';
-               $html5Experimental = 'foo_тест_!_()[]:<>_amp;_amp;amp;';
 
                // Settings: last element is $wgExternalInterwikiFragmentMode, the rest is $wgFragmentMode
                $legacy = [ 'legacy', 'legacy' ];
@@ -464,8 +464,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
@@ -497,18 +495,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 ],
                ];
        }
 
@@ -516,6 +502,7 @@ class SanitizerTest extends MediaWikiTestCase {
         * @dataProvider provideStripAllTags
         *
         * @covers Sanitizer::stripAllTags()
+        * @covers RemexStripTagHandler
         *
         * @param string $input
         * @param string $expected
@@ -530,11 +517,10 @@ class SanitizerTest extends MediaWikiTestCase {
                        [ '<p id="one">Foo</p><p id="two">Bar</p>', 'FooBar' ],
                        [ "<p>Foo</p>\n<p>Bar</p>", 'Foo Bar' ],
                        [ '<p>Hello &lt;strong&gt; wor&#x6c;&#100; caf&eacute;</p>', 'Hello <strong> world café' ],
-                       // This one is broken, see T179978
-                       //[
-                       //      '<p><small data-foo=\'bar"&lt;baz>quux\'><a href="./Foo">Bar</a></small> Whee!</p>',
-                       //      'Bar Whee!'
-                       //],
+                       [
+                               '<p><small data-foo=\'bar"&lt;baz>quux\'><a href="./Foo">Bar</a></small> Whee!</p>',
+                               'Bar Whee!'
+                       ],
                        [ '1<span class="<?php">2</span>3', '123' ],
                        [ '1<span class="<?">2</span>3', '123' ],
                ];