TYPO3 CMS
TYPO3_6-2
Main Page
Related Pages
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
+
Files
File List
+
File Members
+
All
$
(
_
a
c
d
e
f
h
i
l
o
p
r
s
t
u
x
+
Functions
_
a
c
d
e
f
i
l
o
p
r
s
u
x
+
Variables
$
(
_
a
d
e
h
i
p
r
s
t
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
JavaScriptEncoderTest.php
Go to the documentation of this file.
1
<?php
2
namespace
TYPO3\CMS\Core\Tests\Unit\Encoder
;
3
22
class
JavaScriptEncoderTest
extends
\TYPO3\CMS\Core\Tests\UnitTestCase
{
23
27
protected
$fixture
= NULL;
28
29
public
function
setUp
() {
30
$this->fixture = new \TYPO3\CMS\Core\Encoder\JavaScriptEncoder();
31
}
32
38
public
function
encodeEncodesCorrectlyDataProvider
() {
39
return
array(
40
'Immune characters are returned as is'
=> array(
41
'._,'
,
42
'._,'
43
),
44
'Alphanumerical characters are returned as is'
=> array(
45
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
,
46
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
47
),
48
'Angel brackets and ampersand are encoded'
=> array(
49
'<>&'
,
50
'\\x3C\\x3E\\x26'
51
),
52
'Quotes and slashes are encoded'
=> array(
53
'"\'\\/'
,
54
'\\x22\\x27\\x5C\\x2F'
55
),
56
'Empty string stays empty'
=> array(
57
''
,
58
''
59
),
60
'Exclamation mark and space are properly encoded'
=> array(
61
'Hello World!'
,
62
'Hello\\x20World\\x21'
63
),
64
'Whitespaces are properly encoded'
=> array(
65
TAB . LF . CR .
' '
,
66
'\\x09\\x0A\\x0D\\x20'
67
),
68
'Null byte is properly encoded'
=> array(
69
chr(0),
70
'\\x00'
71
),
72
'Umlauts are properly encoded'
=> array(
73
'ÜüÖöÄä'
,
74
'\\xDC\\xFC\\xD6\\xF6\\xC4\\xE4'
75
)
76
);
77
}
78
85
public
function
encodeEncodesCorrectly
($input, $expected) {
86
$this->assertSame($expected, $this->fixture->encode($input));
87
}
88
89
}
TYPO3\CMS\Core\Tests\Unit\Encoder\JavaScriptEncoderTest
Definition:
JavaScriptEncoderTest.php:22
TYPO3\CMS\Core\Tests\Unit\Encoder\JavaScriptEncoderTest\encodeEncodesCorrectlyDataProvider
encodeEncodesCorrectlyDataProvider()
Definition:
JavaScriptEncoderTest.php:38
TYPO3\CMS\Core\Tests\Unit\Encoder\JavaScriptEncoderTest\encodeEncodesCorrectly
encodeEncodesCorrectly($input, $expected)
Definition:
JavaScriptEncoderTest.php:85
TYPO3\CMS\Core\Tests\Unit\Encoder\JavaScriptEncoderTest\setUp
setUp()
Definition:
JavaScriptEncoderTest.php:29
TYPO3\CMS\Core\Tests\Unit\Encoder\JavaScriptEncoderTest\$fixture
$fixture
Definition:
JavaScriptEncoderTest.php:27
TYPO3\CMS\Core\Tests\Unit\Encoder
Definition:
JavaScriptEncoderTest.php:2
TYPO3\CMS\Core\Tests\UnitTestCase
Definition:
UnitTestCase.php:26
typo3
sysext
core
Tests
Unit
Encoder
JavaScriptEncoderTest.php
Generated on Wed Aug 7 2019 09:52:23 for TYPO3 CMS by
1.8.13