From e3e808802916ee15aa4b81dedd195869942c753c Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Sun, 3 Sep 2017 04:49:33 +0200 Subject: [PATCH] Add test for boolean and null --- .../ValueTests/BoolenNull/BooleanNullTest.php | 51 +++++++++++++++++++ .../ValueTests/BoolenNull/cache/dummy.txt | 0 .../ValueTests/BoolenNull/templates/dummy.txt | 0 .../BoolenNull/templates_c/dummy.txt | 0 4 files changed, 51 insertions(+) create mode 100644 tests/UnitTests/TemplateSource/ValueTests/BoolenNull/BooleanNullTest.php create mode 100644 tests/UnitTests/TemplateSource/ValueTests/BoolenNull/cache/dummy.txt create mode 100644 tests/UnitTests/TemplateSource/ValueTests/BoolenNull/templates/dummy.txt create mode 100644 tests/UnitTests/TemplateSource/ValueTests/BoolenNull/templates_c/dummy.txt diff --git a/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/BooleanNullTest.php b/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/BooleanNullTest.php new file mode 100644 index 00000000..9fba0bac --- /dev/null +++ b/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/BooleanNullTest.php @@ -0,0 +1,51 @@ +setUpSmarty(dirname(__FILE__)); + } + + public function testInit() + { + $this->cleanDirs(); + } + /** + * test true + * + */ + public function testTrue() { + $this->smarty->assign('value', true); + $this->assertEquals('true', $this->smarty->fetch('eval:{if $value === true}true{else}false{/if}')); + } + /** + * test false + * + */ + public function testFalse() { + $this->smarty->assign('value', false); + $this->assertEquals('true', $this->smarty->fetch('eval:{if $value === false}true{else}false{/if}')); + } + /** + * test null + * + */ + public function testNull() { + $this->smarty->assign('value', null); + $this->assertEquals('true', $this->smarty->fetch('eval:{if $value === null}true{else}false{/if}')); + } + } diff --git a/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/cache/dummy.txt b/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/cache/dummy.txt new file mode 100644 index 00000000..e69de29b diff --git a/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/templates/dummy.txt b/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/templates/dummy.txt new file mode 100644 index 00000000..e69de29b diff --git a/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/templates_c/dummy.txt b/tests/UnitTests/TemplateSource/ValueTests/BoolenNull/templates_c/dummy.txt new file mode 100644 index 00000000..e69de29b