@@ -48,6 +48,11 @@ public function tearDown() {
48
48
unset($ this ->View );
49
49
}
50
50
51
+ /**
52
+ * test rendering a string
53
+ *
54
+ * @return void
55
+ */
51
56
public function testRenderString () {
52
57
$ template = 'The value of aVariable is: <%= $aVariable %>. ' ;
53
58
@@ -58,6 +63,11 @@ public function testRenderString() {
58
63
$ this ->assertSame ($ expected , $ result , 'variables in erb-style tags should be evaluated ' );
59
64
}
60
65
66
+ /**
67
+ * test rendering a template file
68
+ *
69
+ * @return void
70
+ */
61
71
public function testRenderTemplate () {
62
72
$ this ->View ->set (['aVariable ' => 123 ]);
63
73
$ result = $ this ->View ->render ('view_tests/simple ' );
@@ -66,6 +76,11 @@ public function testRenderTemplate() {
66
76
$ this ->assertSame ($ expected , $ result , 'variables in erb-style tags should be evaluated ' );
67
77
}
68
78
79
+ /**
80
+ * verify that php tags are ignored
81
+ *
82
+ * @return void
83
+ */
69
84
public function testRenderIgnorePhpTags () {
70
85
$ template = 'The value of aVariable is: <%= $aVariable %>. Not <?php echo $aVariable ?>. ' ;
71
86
@@ -76,6 +91,11 @@ public function testRenderIgnorePhpTags() {
76
91
$ this ->assertSame ($ expected , $ result , 'variables in php tags should be treated as strings ' );
77
92
}
78
93
94
+ /**
95
+ * verify that short php tags are ignored
96
+ *
97
+ * @return void
98
+ */
79
99
public function testRenderIgnorePhpShortTags () {
80
100
$ template = 'The value of aVariable is: <%= $aVariable %>. Not <?= $aVariable ?>. ' ;
81
101
@@ -86,6 +106,11 @@ public function testRenderIgnorePhpShortTags() {
86
106
$ this ->assertSame ($ expected , $ result , 'variables in php tags should be treated as strings ' );
87
107
}
88
108
109
+ /**
110
+ * Newlines after template tags should act predictably
111
+ *
112
+ * @return void
113
+ */
89
114
public function testRenderNewlines () {
90
115
$ result = $ this ->View ->render ('view_tests/newlines ' );
91
116
$ expected = "There should be a newline about here: \n" ;
@@ -100,6 +125,11 @@ public function testRenderNewlines() {
100
125
);
101
126
}
102
127
128
+ /**
129
+ * Verify that template tags with leading whitespace don't leave a mess
130
+ *
131
+ * @return void
132
+ */
103
133
public function testSwallowLeadingWhitespace () {
104
134
$ result = $ this ->View ->render ('view_tests/leading-whitespace ' );
105
135
$ expected = $ this ->_getCompareTemplate ('leading-whitespace ' );
0 commit comments