-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathSafeStringTest.php
45 lines (43 loc) · 1.38 KB
/
SafeStringTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* Generated by build/gen_test
*/
use LightnCandy\LightnCandy;
use LightnCandy\Runtime;
use LightnCandy\SafeString;
use PHPUnit\Framework\TestCase;
require_once(__DIR__ . '/test_util.php');
class SafeStringTest extends TestCase
{
/**
* @covers LightnCandy\SafeString::stripExtendedComments
*/
public function testOn_stripExtendedComments() {
$method = new \ReflectionMethod('LightnCandy\SafeString', 'stripExtendedComments');
$this->assertEquals('abc', $method->invokeArgs(null, array_by_ref(array(
'abc'
))));
$this->assertEquals('abc{{!}}cde', $method->invokeArgs(null, array_by_ref(array(
'abc{{!}}cde'
))));
$this->assertEquals('abc{{! }}cde', $method->invokeArgs(null, array_by_ref(array(
'abc{{!----}}cde'
))));
}
/**
* @covers LightnCandy\SafeString::escapeTemplate
*/
public function testOn_escapeTemplate() {
$method = new \ReflectionMethod('LightnCandy\SafeString', 'escapeTemplate');
$this->assertEquals('abc', $method->invokeArgs(null, array_by_ref(array(
'abc'
))));
$this->assertEquals('a\\\\bc', $method->invokeArgs(null, array_by_ref(array(
'a\bc'
))));
$this->assertEquals('a\\\'bc', $method->invokeArgs(null, array_by_ref(array(
'a\'bc'
))));
}
}
?>