diff --git a/tests/lib/template.php b/tests/lib/template.php index 0151ab331d..3f0855de76 100644 --- a/tests/lib/template.php +++ b/tests/lib/template.php @@ -30,17 +30,19 @@ class Test_TemplateFunctions extends UnitTestCase { ob_start(); p($htmlString); $result = ob_get_clean(); + ob_end_clean(); $this->assertEqual("<script>alert('xss');</script>", $result); + } - ob_end_clean(); + public function testPNormalString(){ $normalString = "This is a good string!"; ob_start(); p($normalString); $result = ob_get_clean(); + ob_end_clean(); $this->assertEqual("This is a good string!", $result); - } @@ -50,17 +52,19 @@ class Test_TemplateFunctions extends UnitTestCase { ob_start(); print_unescaped($htmlString); $result = ob_get_clean(); + ob_end_clean(); $this->assertEqual($htmlString, $result); + } - ob_end_clean(); + public function testPrintUnescapedNormalString(){ $normalString = "This is a good string!"; ob_start(); p($normalString); $result = ob_get_clean(); + ob_end_clean(); $this->assertEqual("This is a good string!", $result); - }