From 661ffe75efe2a33c8aca750cfb87d062887e29f5 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Wed, 9 Aug 2017 12:50:32 +0200 Subject: [PATCH] update for 3.1.32-dev --- .../Compiler/Delimiter/AutoLiteralTest.php | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 tests/UnitTests/Compiler/Delimiter/AutoLiteralTest.php diff --git a/tests/UnitTests/Compiler/Delimiter/AutoLiteralTest.php b/tests/UnitTests/Compiler/Delimiter/AutoLiteralTest.php new file mode 100644 index 00000000..1f5e31ea --- /dev/null +++ b/tests/UnitTests/Compiler/Delimiter/AutoLiteralTest.php @@ -0,0 +1,62 @@ +setUpSmarty(dirname(__FILE__)); + } + + public function testInit() + { + $this->cleanDirs(); + } + + /** + * test '{ ' delimiter + */ + public function testSetAutoliteral() + { + $this->smarty->setAutoLiteral(true); + $this->smarty->assign('i','foo'); + $this->assertEquals('{ $i}foo', $this->smarty->fetch('eval:{ $i}{$i}')); + } + + public function testSetAutoliteral2() + { + $this->smarty->setAutoLiteral(false); + $this->smarty->assign('i','foo'); + $this->assertEquals('foofoo', $this->smarty->fetch('eval:{ $i}{$i}')); + } + public function testSetAutoliteral3() + { + $this->smarty->setAutoLiteral(false); + $this->smarty->assign('i','foo'); + $this->assertEquals('{{$i}foo', $this->smarty->fetch('eval:{{$i}{$i}')); + } + public function testSetAutoliteral4() + { + $this->smarty->setAutoLiteral(false); + $this->smarty->assign('i','foo'); + $this->assertEquals('{{ $i}foo', $this->smarty->fetch('eval:{{ $i}{$i}')); + } + public function testSetAutoliteral5() + { + $this->smarty->setAutoLiteral(true); + $this->smarty->assign('i','foo'); + $this->assertEquals('{ {{$i}foo', $this->smarty->fetch('eval:{ {{$i}{$i}')); + } +}