Merge "Update docs/hooks.txt for ShowSearchHitTitle"
[mediawiki.git] / tests / phpunit / includes / libs / HtmlArmorTest.php
blob5f176e0c85c3d5353a17aba07906baede3ffba2b
1 <?php
3 /**
4 * @covers HtmlArmor
5 */
6 class HtmlArmorTest extends PHPUnit_Framework_TestCase {
8 public static function provideHtmlArmor() {
9 return [
11 'foobar',
12 'foobar',
15 '<script>alert("evil!");</script>',
16 '&lt;script&gt;alert(&quot;evil!&quot;);&lt;/script&gt;',
19 new HtmlArmor( '<script>alert("evil!");</script>' ),
20 '<script>alert("evil!");</script>',
25 /**
26 * @dataProvider provideHtmlArmor
28 public function testHtmlArmor( $input, $expected ) {
29 $this->assertEquals(
30 $expected,
31 HtmlArmor::getHtml( $input )