From 12f81910012eaa57a87ac02919299245ec8bb49e Mon Sep 17 00:00:00 2001 From: Gnieark Date: Mon, 26 Mar 2018 07:48:39 +0200 Subject: [PATCH] Unit test --- test/TplBlockTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/TplBlockTest.php b/test/TplBlockTest.php index 1b6b362..659314d 100644 --- a/test/TplBlockTest.php +++ b/test/TplBlockTest.php @@ -140,5 +140,21 @@ class TplBlockTest extends TestCase new TplBlock("kjsd54.5"); } + public function testIfRemoveNonGivenVarsWorks(){ + + $tpl = new TplBlock(); + $resultWithReplace = $tpl + ->doReplaceNonGivenVars() + ->applyTplStr("Hello {{name}}"); + $resultWithoutReplace = $tpl + ->dontReplaceNonGivenVars() + ->applyTplStr("Hello {{name}}"); + + + $this->assertContains("name",$resultWithoutReplace); + $this->assertFalse(strpos("name", $resultWithReplace)); + + + } }