Update for 3.1.32-dev-23

This commit is contained in:
Uwe Tews
2017-10-07 08:22:00 +02:00
parent e3e8088029
commit 462efddfdf
290 changed files with 523 additions and 285 deletions

View File

@@ -3,29 +3,29 @@
* This file is part of the Smarty PHPUnit tests.
*
*/
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__), FilesystemIterator::SKIP_DOTS),
RecursiveIteratorIterator::CHILD_FIRST) as $path) {
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__), FilesystemIterator::SKIP_DOTS)) as $path)
{
$p = $path->getPathname();
if ((strpos($p, '\coverage') !== false) ||
((strpos($p, '\templates_c') === false) && (strpos($p, '\cache\\') === false) &&
(strpos($p, '\templates_tmp') === false))
) {
continue;
}
$p = $path->getPathname();
$i = 1;
//$path->isDir() && !$path->isLink() ? rmdir($path->getPathname()) : unlink($path->getPathname());
if ($path->isDir() && !$path->isLink()) {
if (strpos($p, '\templates_tmp') !== false) {
rmdir($path->getPathname());
if ((strpos($p, '\templates_c') !== false) || (strpos($p, '\cache') !== false) ||
(strpos($p, '\templates_tmp') !== false)) {
$path2 = $path;
$pp = $path->getPath();
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path->getPath(). '\\', FilesystemIterator::SKIP_DOTS),
RecursiveIteratorIterator::CHILD_FIRST) as $path2) {
$p2 = $path2->getPathname();
if ((strpos($p2, '\templates_c\\') !== false) || (strpos($p2, '\cache\\') !== false) ||
(strpos($p2, '\templates_tmp\\') !== false)) {
if ($path2->isDir() && !$path2->isLink()) {
rmdir($p2);
} else {
touch($path->getPathname() . '/dummy.txt');
unlink($p2);
}
} else {
unlink($path->getPathname());
if (strpos($p, '\templates_tmp') === false) {
touch($path->getPath() . '/dummy.txt');
}
}
$name = $pp. '\dummy.txt';
file_put_contents($name,'dummy');
}
}

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -18,6 +18,7 @@ class AutoliteralTest extends PHPUnit_Smarty
public function setUp()
{
$this->setUpSmarty(dirname(__FILE__));
$this->smarty->addPluginsDir("../../__shared/PHPunitplugins/");
}
public function testInit()
@@ -32,31 +33,27 @@ class AutoliteralTest extends PHPUnit_Smarty
{
$this->smarty->setAutoLiteral(true);
$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()
{
$this->smarty->setAutoLiteral(false);
$this->smarty->setCompileId(1);
$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()
{
$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()
public function testSetAutoliteralBlock()
{
$this->smarty->setAutoLiteral(true);
$this->smarty->assign('i','foo');
$this->assertEquals('{ {{$i}foo', $this->smarty->fetch('eval:{ {{$i}{$i}'));
$this->assertEquals('{ dummyblock}foo{ /dummyblock}', $this->smarty->fetch('autoliteralblock.tpl'));
}
public function testSetAutoliteralBlock1()
{
$this->smarty->setAutoLiteral(false);
$this->smarty->setCompileId(1);
$this->assertEquals('foo', $this->smarty->fetch('autoliteralblock.tpl'));
}
}

View File

@@ -35,6 +35,16 @@ class DelimiterTest extends PHPUnit_Smarty
$tpl = $this->smarty->createTemplate('eval:<{* comment *}><{if true}><{"hello world"}><{/if}>');
$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

View 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'));
}
}

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
{ $i}{$i}

View File

@@ -0,0 +1 @@
{ dummyblock}foo{ /dummyblock}

View File

@@ -0,0 +1 @@
{{ 1 }}

View File

@@ -0,0 +1 @@
{{1}}

View File

@@ -0,0 +1 @@
<- 1 -> <--1-->

View File

@@ -97,7 +97,7 @@ class CustomResourceAmbiguousTest extends PHPUnit_Smarty
/**
*
* @runInSeparateProcess
* @run InSeparateProcess
* @preserveGlobalState disabled
*
*/

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

View File

@@ -0,0 +1 @@
dummy

Some files were not shown because too many files have changed in this diff Show More