mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
update for 3.1.32-dev
This commit is contained in:
62
tests/UnitTests/Compiler/Delimiter/AutoLiteralTest.php
Normal file
62
tests/UnitTests/Compiler/Delimiter/AutoLiteralTest.php
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Smarty PHPunit tests of delimiter
|
||||||
|
*
|
||||||
|
* @package PHPunit
|
||||||
|
* @author Uwe Tews
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* class for delimiter tests
|
||||||
|
*
|
||||||
|
* @runTestsInSeparateProcess
|
||||||
|
* @preserveGlobalState disabled
|
||||||
|
* @backupStaticAttributes enabled
|
||||||
|
*/
|
||||||
|
class AutoliteralTest extends PHPUnit_Smarty
|
||||||
|
{
|
||||||
|
public function setUp()
|
||||||
|
{
|
||||||
|
$this->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}'));
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user