]> git.andy128k.dev Git - ipf-template.git/commitdiff
one more test 0.2
authorAndrey Kutejko <andy128k@gmail.com>
Sun, 28 Feb 2016 14:48:53 +0000 (15:48 +0100)
committerAndrey Kutejko <andy128k@gmail.com>
Sun, 28 Feb 2016 14:48:53 +0000 (15:48 +0100)
t/TemplateTest.php

index c1d9f11a433820ade113a85c1eb2f836111bcd8a..0d28c69fa67d235d534b4d1ad8fb1f509fe12cae 100644 (file)
@@ -12,6 +12,16 @@ class Template_Test extends PHPUnit_Framework_TestCase
         $this->assertEquals('Hello, (&gt;.&lt;)!', $template->render(new IPF_Template_Context(array('name' => '(>.<)'))));
     }
 
+    public function testStringTemplateWithModifiers()
+    {
+        $environment = new IPF_Template_Environment_FileSystem;
+        $environment->cache = '/tmp';
+        $template = new IPF_Template_String('Hello, {$name|upper}!', $environment);
+
+        $this->assertEquals('Hello, WORLD!', $template->render(new IPF_Template_Context(array('name' => 'World'))));
+        $this->assertEquals('Hello, (&gt;.&lt;)!', $template->render(new IPF_Template_Context(array('name' => '(>.<)'))));
+    }
+
     public function testLimitWords()
     {
         $lipsum = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';