Skip to content

Commit 7568532

Browse files
committed
Add PGP function and modifier test
1 parent e0d2669 commit 7568532

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/include/functionsSmartyTest.php

+25
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,30 @@ public function test_smarty_renders_ifRemember()
133133
$result = $serendipity['smarty']->fetch('eval:' . $template_string);
134134
$this->assertEquals(false, $result);
135135
}
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+
}
136161

137162
}

0 commit comments

Comments
 (0)