Commit 7568532 1 parent e0d2669 commit 7568532 Copy full SHA for 7568532
File tree 1 file changed +25
-0
lines changed
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -133,5 +133,30 @@ public function test_smarty_renders_ifRemember()
133
133
$ result = $ serendipity ['smarty ' ]->fetch ('eval: ' . $ template_string );
134
134
$ this ->assertEquals (false , $ result );
135
135
}
136
+ #[Test]
137
+
138
+ public function test_smarty_renders_nl2br ()
139
+ {
140
+ global $ serendipity ;
141
+
142
+ serendipity_smarty_init ();
143
+
144
+ $ template_string = '{"a
145
+ b"|@nl2br} ' ;
146
+ $ result = $ serendipity ['smarty ' ]->fetch ('eval: ' . $ template_string );
147
+ $ this ->assertEquals ("a<br /> \nb " , $ result );
148
+ }
149
+
150
+ public function test_smarty_renders_sizeof ()
151
+ {
152
+ global $ serendipity ;
153
+
154
+ serendipity_smarty_init ();
155
+
156
+ $ serendipity ['smarty ' ]->assign ('config ' , ['a ' , 'b ' ]);
157
+ $ template_string = '{$config|sizeof} ' ;
158
+ $ result = $ serendipity ['smarty ' ]->fetch ('eval: ' . $ template_string );
159
+ $ this ->assertEquals ("2 " , $ result );
160
+ }
136
161
137
162
}
You can’t perform that action at this time.
0 commit comments