MediaWiki
REL1_30
HtmlArmorTest.php
Go to the documentation of this file.
1
<?php
2
6
class
HtmlArmorTest
extends
PHPUnit_Framework_TestCase {
7
8
public
static
function
provideHtmlArmor
() {
9
return
[
10
[
11
'foobar'
,
12
'foobar'
,
13
],
14
[
15
'<script>alert("evil!");</script>'
,
16
'<script>alert("evil!");</script>'
,
17
],
18
[
19
new
HtmlArmor
(
'<script>alert("evil!");</script>'
),
20
'<script>alert("evil!");</script>'
,
21
],
22
];
23
}
24
28
public
function
testHtmlArmor
(
$input
, $expected ) {
29
$this->assertEquals(
30
$expected,
31
HtmlArmor::getHtml(
$input
)
32
);
33
}
34
}
HtmlArmorTest
HtmlArmor.
Definition
HtmlArmorTest.php:6
HtmlArmorTest\testHtmlArmor
testHtmlArmor( $input, $expected)
provideHtmlArmor
Definition
HtmlArmorTest.php:28
HtmlArmorTest\provideHtmlArmor
static provideHtmlArmor()
Definition
HtmlArmorTest.php:8
HtmlArmor
Marks HTML that shouldn't be escaped.
Definition
HtmlArmor.php:28
$input
if(is_array($mode)) switch( $mode) $input
Definition
postprocess-phan.php:141
tests
phpunit
includes
libs
HtmlArmorTest.php
Generated on Mon Nov 25 2024 15:43:49 for MediaWiki by
1.10.0