Hoo man has uploaded a new change for review.
https://gerrit.wikimedia.org/r/185088
Change subject: Add tests for Sanitizer::escapeHtmlAllowEntities
......................................................................
Add tests for Sanitizer::escapeHtmlAllowEntities
Change-Id: I84a1328559d57a424aa77a6d89f837615feffc13
---
M tests/phpunit/includes/SanitizerTest.php
1 file changed, 21 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/88/185088/1
diff --git a/tests/phpunit/includes/SanitizerTest.php
b/tests/phpunit/includes/SanitizerTest.php
index f960f48..7be4bd3 100644
--- a/tests/phpunit/includes/SanitizerTest.php
+++ b/tests/phpunit/includes/SanitizerTest.php
@@ -340,4 +340,25 @@
$message
);
}
+
+ /**
+ * @dataProvider provideEscapeHtmlAllowEntities
+ * @covers Sanitizer::escapeHtmlAllowEntities
+ */
+ public function testEscapeHtmlAllowEntities( $expected, $html,
$specialCharFlags = ENT_QUOTES ) {
+ $this->assertEquals(
+ $expected,
+ Sanitizer::escapeHtmlAllowEntities( $html,
$specialCharFlags )
+ );
+ }
+
+ public static function provideEscapeHtmlAllowEntities() {
+ return array(
+ array( 'foo', 'foo' ),
+ array( 'a¡b', 'a¡b' ),
+ array( 'foo'bar', "foo'bar" ),
+ array( '<script>foo</script>',
'<script>foo</script>' ),
+ );
+ }
+
}
--
To view, visit https://gerrit.wikimedia.org/r/185088
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I84a1328559d57a424aa77a6d89f837615feffc13
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits