MediaWiki
REL1_32
ResourceLoaderLessVarFileModuleTest.php
Go to the documentation of this file.
1
<?php
2
6
class
ResourceLoaderLessVarFileModuleTest
extends
ResourceLoaderTestCase
{
7
8
public
static
function
providerWrapAndEscapeMessage
() {
9
return
[
10
[
11
"Foo"
,
'"Foo"'
,
12
],
13
[
14
"Foo bananas"
,
'"Foo bananas"'
,
15
],
16
[
17
"Who's that test? Who's that test? It's Jess!"
,
18
'"Who\\\'s that test? Who\\\'s that test? It\\\'s Jess!"'
,
19
],
20
[
21
'Hello "he" said'
,
22
'"Hello \"he\" said"'
,
23
],
24
[
25
'boo";-o-link:javascript:alert(1);color:red;content:"'
,
26
'"boo\";-o-link:javascript:alert(1);color:red;content:\""'
,
27
],
28
[
29
'"jon\'s"'
,
30
'"\"jon\\\'s\""'
31
]
32
];
33
}
38
public
function
testEscapeMessage
( $msg, $expected ) {
39
$method =
new
ReflectionMethod( ResourceLoaderLessVarFileModule::class,
'wrapAndEscapeMessage'
);
40
$method->setAccessible(
true
);
41
$this->assertEquals( $expected, $method->invoke(
null
, $msg ) );
42
}
43
}
ResourceLoaderLessVarFileModuleTest
ResourceLoader.
Definition
ResourceLoaderLessVarFileModuleTest.php:6
ResourceLoaderLessVarFileModuleTest\testEscapeMessage
testEscapeMessage( $msg, $expected)
providerWrapAndEscapeMessage ResourceLoaderLessVarFileModule::wrapAndEscapeMessage
Definition
ResourceLoaderLessVarFileModuleTest.php:38
ResourceLoaderLessVarFileModuleTest\providerWrapAndEscapeMessage
static providerWrapAndEscapeMessage()
Definition
ResourceLoaderLessVarFileModuleTest.php:8
ResourceLoaderTestCase
Definition
ResourceLoaderTestCase.php:7
tests
phpunit
includes
resourceloader
ResourceLoaderLessVarFileModuleTest.php
Generated on Mon Nov 25 2024 15:58:50 for MediaWiki by
1.10.0