mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
Update for 3.1.32-dev-23
This commit is contained in:
@@ -3,29 +3,29 @@
|
|||||||
* This file is part of the Smarty PHPUnit tests.
|
* This file is part of the Smarty PHPUnit tests.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__), FilesystemIterator::SKIP_DOTS),
|
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__), FilesystemIterator::SKIP_DOTS)) as $path)
|
||||||
RecursiveIteratorIterator::CHILD_FIRST) as $path) {
|
{
|
||||||
$p = $path->getPathname();
|
$p = $path->getPathname();
|
||||||
if ((strpos($p, '\coverage') !== false) ||
|
if ((strpos($p, '\templates_c') !== false) || (strpos($p, '\cache') !== false) ||
|
||||||
((strpos($p, '\templates_c') === false) && (strpos($p, '\cache\\') === false) &&
|
(strpos($p, '\templates_tmp') !== false)) {
|
||||||
(strpos($p, '\templates_tmp') === false))
|
$path2 = $path;
|
||||||
) {
|
$pp = $path->getPath();
|
||||||
continue;
|
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path->getPath(). '\\', FilesystemIterator::SKIP_DOTS),
|
||||||
}
|
RecursiveIteratorIterator::CHILD_FIRST) as $path2) {
|
||||||
$p = $path->getPathname();
|
$p2 = $path2->getPathname();
|
||||||
$i = 1;
|
if ((strpos($p2, '\templates_c\\') !== false) || (strpos($p2, '\cache\\') !== false) ||
|
||||||
//$path->isDir() && !$path->isLink() ? rmdir($path->getPathname()) : unlink($path->getPathname());
|
(strpos($p2, '\templates_tmp\\') !== false)) {
|
||||||
if ($path->isDir() && !$path->isLink()) {
|
if ($path2->isDir() && !$path2->isLink()) {
|
||||||
if (strpos($p, '\templates_tmp') !== false) {
|
rmdir($p2);
|
||||||
rmdir($path->getPathname());
|
} else {
|
||||||
} else {
|
unlink($p2);
|
||||||
touch($path->getPathname() . '/dummy.txt');
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
unlink($path->getPathname());
|
|
||||||
if (strpos($p, '\templates_tmp') === false) {
|
|
||||||
touch($path->getPath() . '/dummy.txt');
|
|
||||||
}
|
}
|
||||||
|
$name = $pp. '\dummy.txt';
|
||||||
|
|
||||||
|
file_put_contents($name,'dummy');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -18,6 +18,7 @@ class AutoliteralTest extends PHPUnit_Smarty
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
$this->setUpSmarty(dirname(__FILE__));
|
$this->setUpSmarty(dirname(__FILE__));
|
||||||
|
$this->smarty->addPluginsDir("../../__shared/PHPunitplugins/");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testInit()
|
public function testInit()
|
||||||
@@ -32,31 +33,27 @@ class AutoliteralTest extends PHPUnit_Smarty
|
|||||||
{
|
{
|
||||||
$this->smarty->setAutoLiteral(true);
|
$this->smarty->setAutoLiteral(true);
|
||||||
$this->smarty->assign('i','foo');
|
$this->smarty->assign('i','foo');
|
||||||
$this->assertEquals('{ $i}foo', $this->smarty->fetch('eval:{ $i}{$i}'));
|
$this->assertEquals('{ $i}foo', $this->smarty->fetch('autoliteral.tpl'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSetAutoliteral2()
|
public function testSetAutoliteral2()
|
||||||
{
|
{
|
||||||
$this->smarty->setAutoLiteral(false);
|
$this->smarty->setAutoLiteral(false);
|
||||||
|
$this->smarty->setCompileId(1);
|
||||||
$this->smarty->assign('i','foo');
|
$this->smarty->assign('i','foo');
|
||||||
$this->assertEquals('foofoo', $this->smarty->fetch('eval:{ $i}{$i}'));
|
$this->assertEquals('foofoo', $this->smarty->fetch('autoliteral.tpl'));
|
||||||
}
|
}
|
||||||
public function testSetAutoliteral3()
|
|
||||||
{
|
public function testSetAutoliteralBlock()
|
||||||
$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->setAutoLiteral(true);
|
||||||
$this->smarty->assign('i','foo');
|
$this->assertEquals('{ dummyblock}foo{ /dummyblock}', $this->smarty->fetch('autoliteralblock.tpl'));
|
||||||
$this->assertEquals('{ {{$i}foo', $this->smarty->fetch('eval:{ {{$i}{$i}'));
|
|
||||||
}
|
}
|
||||||
|
public function testSetAutoliteralBlock1()
|
||||||
|
{
|
||||||
|
$this->smarty->setAutoLiteral(false);
|
||||||
|
$this->smarty->setCompileId(1);
|
||||||
|
$this->assertEquals('foo', $this->smarty->fetch('autoliteralblock.tpl'));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -35,6 +35,16 @@ class DelimiterTest extends PHPUnit_Smarty
|
|||||||
$tpl = $this->smarty->createTemplate('eval:<{* comment *}><{if true}><{"hello world"}><{/if}>');
|
$tpl = $this->smarty->createTemplate('eval:<{* comment *}><{if true}><{"hello world"}><{/if}>');
|
||||||
$this->assertEquals("hello world", $this->smarty->fetch($tpl));
|
$this->assertEquals("hello world", $this->smarty->fetch($tpl));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* test <{ }> delimiter
|
||||||
|
*/
|
||||||
|
public function testDelimiter10()
|
||||||
|
{
|
||||||
|
$this->smarty->left_delimiter = '<';
|
||||||
|
$this->smarty->right_delimiter = '>';
|
||||||
|
$tpl = $this->smarty->createTemplate('eval:<* comment *><if 1 < 2><"hello world"></if>');
|
||||||
|
$this->assertEquals("hello world", $this->smarty->fetch($tpl));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test <-{ }-> delimiter
|
* test <-{ }-> delimiter
|
||||||
|
66
tests/UnitTests/Compiler/Delimiter/UserLiteralTest.php
Normal file
66
tests/UnitTests/Compiler/Delimiter/UserLiteralTest.php
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Smarty PHPunit tests of delimiter
|
||||||
|
*
|
||||||
|
* @package PHPunit
|
||||||
|
* @author Uwe Tews
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* class for delimiter tests
|
||||||
|
*
|
||||||
|
* @runTestsInSeparateProcess
|
||||||
|
* @preserveGlobalState disabled
|
||||||
|
* @backupStaticAttributes enabled
|
||||||
|
*/
|
||||||
|
class UserliteralTest extends PHPUnit_Smarty
|
||||||
|
{
|
||||||
|
public function setUp()
|
||||||
|
{
|
||||||
|
if (!property_exists('Smarty', 'literals')) {
|
||||||
|
$this->markTestSkipped('user literal support');
|
||||||
|
} else {
|
||||||
|
$this->setUpSmarty(dirname(__FILE__));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testInit()
|
||||||
|
{
|
||||||
|
$this->cleanDirs();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testUserLiteral()
|
||||||
|
{
|
||||||
|
$this->smarty->setAutoLiteral(true);
|
||||||
|
$this->assertEquals('{{ 1 }}', $this->smarty->fetch('userliteral.tpl'));
|
||||||
|
}
|
||||||
|
public function testUserLiteral1()
|
||||||
|
{
|
||||||
|
$this->smarty->setAutoLiteral(false);
|
||||||
|
$this->smarty->setCompileId(1);
|
||||||
|
$this->assertEquals('1', $this->smarty->fetch('userliteral.tpl'));
|
||||||
|
}
|
||||||
|
public function testUserLiteral2()
|
||||||
|
{
|
||||||
|
$this->smarty->setAutoLiteral(false);
|
||||||
|
$this->smarty->setLiterals(array('{{','}}'));
|
||||||
|
$this->assertEquals('{{1}}', $this->smarty->fetch('userliteral1.tpl'));
|
||||||
|
}
|
||||||
|
public function testUserLiteral3()
|
||||||
|
{
|
||||||
|
$this->smarty->setAutoLiteral(false);
|
||||||
|
$this->smarty->setLeftDelimiter('<-');
|
||||||
|
$this->smarty->setRightDelimiter('->');
|
||||||
|
$this->smarty->setLiterals(array('<--','-->'));
|
||||||
|
$this->assertEquals('1 <--1-->', $this->smarty->fetch('userliteral2.tpl'));
|
||||||
|
}
|
||||||
|
public function testUserLiteral4()
|
||||||
|
{
|
||||||
|
$this->smarty->setAutoLiteral(true);
|
||||||
|
$this->smarty->setLeftDelimiter('<-');
|
||||||
|
$this->smarty->setRightDelimiter('->');
|
||||||
|
$this->smarty->setCompileId(1);
|
||||||
|
$this->smarty->setLiterals(array('<--','-->'));
|
||||||
|
$this->assertEquals('<- 1 -> <--1-->', $this->smarty->fetch('userliteral2.tpl'));
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
{ $i}{$i}
|
@@ -0,0 +1 @@
|
|||||||
|
{ dummyblock}foo{ /dummyblock}
|
@@ -0,0 +1 @@
|
|||||||
|
{{ 1 }}
|
@@ -0,0 +1 @@
|
|||||||
|
{{1}}
|
@@ -0,0 +1 @@
|
|||||||
|
<- 1 -> <--1-->
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -97,7 +97,7 @@ class CustomResourceAmbiguousTest extends PHPUnit_Smarty
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @runInSeparateProcess
|
* @run InSeparateProcess
|
||||||
* @preserveGlobalState disabled
|
* @preserveGlobalState disabled
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
@@ -0,0 +1 @@
|
|||||||
|
dummy
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user