From 91daac7d3b67b3f8c29b93a169468365cd0af457 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Fri, 29 Mar 2024 22:42:28 +0100 Subject: [PATCH] unit tests --- .../GetTemplateVars/cache/.gitignore | 2 -- .../GetTemplateVars/templates_c/.gitignore | 2 -- .../GetTemplateVarsTest.php | 0 .../TemplateVars/HasVariableTest.php | 32 +++++++++++++++++++ 4 files changed, 32 insertions(+), 4 deletions(-) delete mode 100644 tests/UnitTests/SmartyMethodsTests/GetTemplateVars/cache/.gitignore delete mode 100644 tests/UnitTests/SmartyMethodsTests/GetTemplateVars/templates_c/.gitignore rename tests/UnitTests/SmartyMethodsTests/{GetTemplateVars => TemplateVars}/GetTemplateVarsTest.php (100%) create mode 100644 tests/UnitTests/SmartyMethodsTests/TemplateVars/HasVariableTest.php diff --git a/tests/UnitTests/SmartyMethodsTests/GetTemplateVars/cache/.gitignore b/tests/UnitTests/SmartyMethodsTests/GetTemplateVars/cache/.gitignore deleted file mode 100644 index d88cc1446..000000000 --- a/tests/UnitTests/SmartyMethodsTests/GetTemplateVars/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/GetTemplateVars/templates_c/.gitignore b/tests/UnitTests/SmartyMethodsTests/GetTemplateVars/templates_c/.gitignore deleted file mode 100644 index d88cc1446..000000000 --- a/tests/UnitTests/SmartyMethodsTests/GetTemplateVars/templates_c/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore anything in here, but keep this directory -* diff --git a/tests/UnitTests/SmartyMethodsTests/GetTemplateVars/GetTemplateVarsTest.php b/tests/UnitTests/SmartyMethodsTests/TemplateVars/GetTemplateVarsTest.php similarity index 100% rename from tests/UnitTests/SmartyMethodsTests/GetTemplateVars/GetTemplateVarsTest.php rename to tests/UnitTests/SmartyMethodsTests/TemplateVars/GetTemplateVarsTest.php diff --git a/tests/UnitTests/SmartyMethodsTests/TemplateVars/HasVariableTest.php b/tests/UnitTests/SmartyMethodsTests/TemplateVars/HasVariableTest.php new file mode 100644 index 000000000..047af7b90 --- /dev/null +++ b/tests/UnitTests/SmartyMethodsTests/TemplateVars/HasVariableTest.php @@ -0,0 +1,32 @@ +setUpSmarty(__DIR__); + } + + + public function testInit() + { + $this->cleanDirs(); + } + + public function testSimpleTrue() + { + $this->smarty->assign('foo', 'bar'); + $this->assertTrue($this->smarty->hasVariable('foo')); + } + + + public function testSimpleFalse() + { + $this->smarty->assign('foo', 'bar'); + $this->assertFalse($this->smarty->hasVariable('foox')); + } + +}