Catrope has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/391347 )
Change subject: SanitizerTest: Add tests for stripAllTags ...................................................................... SanitizerTest: Add tests for stripAllTags Bug: T179978 Change-Id: I9776cfd51b1b3ec772d4216168fbe466f48f5892 --- M tests/phpunit/includes/SanitizerTest.php 1 file changed, 23 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/47/391347/1 diff --git a/tests/phpunit/includes/SanitizerTest.php b/tests/phpunit/includes/SanitizerTest.php index 6fc25df..4a33125 100644 --- a/tests/phpunit/includes/SanitizerTest.php +++ b/tests/phpunit/includes/SanitizerTest.php @@ -513,6 +513,29 @@ } /** + * @dataProvider provideStripAllTags + * + * @covers Sanitizer::stripAllTags() + * + * @param string $input + * @param string $expected + */ + public function testStripAllTags( $input, $expected ) { + $this->assertEquals( $expected, Sanitizer::stripAllTags( $input ) ); + } + + public function provideStripAllTags() { + return [ + [ '<p>Foo</p>', 'Foo' ], + [ '<p id="one">Foo</p><p id="two">Bar</p>', 'FooBar' ], + [ "<p>Foo</p>\n<p>Bar</p>", 'Foo Bar' ], + [ '<p>Hello <strong> world café</p>', 'Hello <strong> world cafĂ©' ], + // This one is broken, see T179978 + //[ '<p><small data-foo=\'bar"<baz>quux\'><a href="./Foo">Bar</a></small> Whee!</p>', 'Bar Whee!' ], + ]; + } + + /** * @expectedException InvalidArgumentException * @covers Sanitizer::escapeIdInternal() */ -- To view, visit https://gerrit.wikimedia.org/r/391347 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9776cfd51b1b3ec772d4216168fbe466f48f5892 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Catrope <r...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits