mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
replace __DIR__
This commit is contained in:
@@ -17,7 +17,7 @@ class PathNormalizationTest extends PHPUnit_Smarty
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testNormalizeToAbsolute() {
|
||||
|
@@ -17,7 +17,7 @@ class ProtectedFolderVarsTest extends PHPUnit_Smarty
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -15,7 +15,7 @@ class UndefinedTemplateVarTest extends PHPUnit_Smarty
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class AutoEscapeTest extends PHPUnit_Smarty
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smarty->setEscapeHtml(true);
|
||||
}
|
||||
|
||||
|
@@ -96,6 +96,19 @@ class FilterTest extends PHPUnit_Smarty
|
||||
$this->assertEquals("bar hello world", $this->smarty->fetch($tpl));
|
||||
}
|
||||
|
||||
/**
|
||||
* test registered pre filter closure
|
||||
*/
|
||||
public function testRegisteredPreFilterClosure()
|
||||
{
|
||||
if (version_compare(PHP_VERSION, '5.2', '<=')) {
|
||||
$this->markTestSkipped('closure not available');
|
||||
}
|
||||
$this->smarty->registerFilter(Smarty::FILTER_PRE, function($input) {return '{$foo}' . $input;});
|
||||
$tpl = $this->smarty->createTemplate('eval:{" hello world"}');
|
||||
$tpl->assign('foo', 'buh');
|
||||
$this->assertEquals("buh hello world", $this->smarty->fetch($tpl));
|
||||
}
|
||||
|
||||
/**
|
||||
* test registered pre filter class
|
||||
|
@@ -17,7 +17,7 @@ class LoadFilterTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -17,7 +17,7 @@ class RegisterFilterTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -17,7 +17,7 @@ class GetterSetterTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
|
@@ -17,7 +17,7 @@ class DefaultPluginHandlerTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smarty->setForceCompile(true);
|
||||
$this->smarty->disableSecurity();
|
||||
$this->smarty->registerDefaultPluginHandler('my_plugin_handler');
|
||||
|
@@ -13,12 +13,12 @@ class IncludePathTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smarty->use_include_path = true;
|
||||
$this->smarty->setPluginsDir(array('./include','./include1'));
|
||||
$this->smarty->enableSecurity();
|
||||
$ds = DS;
|
||||
set_include_path($this->smarty->_realpath(__DIR__ . "{$ds}..{$ds}..{$ds}..{$ds}Include_Path{$ds}Plugins{$ds}", true) . PATH_SEPARATOR . get_include_path());
|
||||
set_include_path($this->smarty->_realpath(dirname(__FILE__) . "{$ds}..{$ds}..{$ds}..{$ds}Include_Path{$ds}Plugins{$ds}", true) . PATH_SEPARATOR . get_include_path());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -17,7 +17,7 @@ class LoadPluginTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -19,7 +19,7 @@ class MuteExpectedErrorsTest extends PHPUnit_Smarty
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class OutputFilterTrimWhitespaceTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smarty->loadFilter('output', 'trimwhitespace');
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class PluginChainedLoadTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
@@ -27,7 +27,7 @@ class PluginChainedLoadTest extends PHPUnit_Smarty
|
||||
|
||||
public function testPluginChainedLoad()
|
||||
{
|
||||
$this->smarty->addPluginsDir(__DIR__ . "/PHPunitplugins/");
|
||||
$this->smarty->addPluginsDir(dirname(__FILE__) . "/PHPunitplugins/");
|
||||
$this->assertContains('from chain3', $this->smarty->fetch('test_plugin_chained_load.tpl'));
|
||||
}
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ class SharedFunctionsTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -19,7 +19,7 @@ class SmartyBcTest extends PHPUnit_Smarty
|
||||
public $loadSmarty = false;
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -19,7 +19,7 @@ class HttpModifiedSinceTest extends PHPUnit_Smarty
|
||||
public function setUp()
|
||||
{
|
||||
$this->markTestSkipped('modified since tests are disabled');
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Uwe Tews
|
||||
*/
|
||||
if (ApcCacheEnable == true) {
|
||||
include_once __DIR__ . '/../Memcache/CacheResourceCustomMemcacheTest.php';
|
||||
include_once dirname(__FILE__) . '/../Memcache/CacheResourceCustomMemcacheTest.php';
|
||||
|
||||
/**
|
||||
* class for cache resource file tests
|
||||
@@ -26,7 +26,7 @@ if (ApcCacheEnable == true) {
|
||||
$this->markTestSkipped('APC cache not available');
|
||||
}
|
||||
}
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
parent::setUp();
|
||||
$this->smarty->setCachingType('apc');
|
||||
$this->smarty->addPluginsDir(SMARTY_DIR . '../demo/plugins/');
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Uwe Tews
|
||||
*/
|
||||
|
||||
include_once __DIR__ . '/../_shared/CacheResourceTestCommon.php';
|
||||
include_once dirname(__FILE__) . '/../_shared/CacheResourceTestCommon.php';
|
||||
|
||||
/**
|
||||
* class for cache resource file tests
|
||||
@@ -20,7 +20,7 @@ class CacheResourceFileTest extends CacheResourceTestCommon
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
parent::setUp();
|
||||
$this->smarty->setCachingType('filetest');
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
if (MemCacheEnable == true) {
|
||||
|
||||
include_once __DIR__ . '/../_shared/CacheResourceTestCommon.php';
|
||||
include_once dirname(__FILE__) . '/../_shared/CacheResourceTestCommon.php';
|
||||
|
||||
/**
|
||||
* class for cache resource memcache tests
|
||||
@@ -28,7 +28,7 @@ if (MemCacheEnable == true) {
|
||||
if (MemCacheEnable != true) {
|
||||
$this->markTestSkipped('Memcache tests are disabled');
|
||||
}
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
parent::setUp();
|
||||
$this->smarty->setCachingType('memcachetest');
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
if (MysqlCacheEnable == true) {
|
||||
|
||||
include_once __DIR__ . '/../_shared/CacheResourceTestCommon.php';
|
||||
include_once dirname(__FILE__) . '/../_shared/CacheResourceTestCommon.php';
|
||||
|
||||
/**
|
||||
* class for cache resource file tests
|
||||
@@ -27,7 +27,7 @@ if (MysqlCacheEnable == true) {
|
||||
if (self::$init) {
|
||||
$this->getConnection();
|
||||
}
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
parent::setUp();
|
||||
$this->smarty->setCachingType('mysqltest');
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
if (PdoCacheEnable == true) {
|
||||
|
||||
include_once __DIR__ . '/../_shared/CacheResourceTestCommon.php';
|
||||
include_once dirname(__FILE__) . '/../_shared/CacheResourceTestCommon.php';
|
||||
|
||||
/**
|
||||
* class for cache resource file tests
|
||||
@@ -27,7 +27,7 @@ if (PdoCacheEnable == true) {
|
||||
if (self::$init) {
|
||||
$this->getConnection();
|
||||
}
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
parent::setUp();
|
||||
$this->smarty->setCachingType('pdo');
|
||||
$this->smarty->addPluginsDir(SMARTY_DIR . '../demo/plugins/');
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
if (PdoGzipCacheEnable == true) {
|
||||
|
||||
include_once __DIR__ . '/../_shared/CacheResourceTestCommon.php';
|
||||
include_once dirname(__FILE__) . '/../_shared/CacheResourceTestCommon.php';
|
||||
|
||||
/**
|
||||
* class for cache resource file tests
|
||||
@@ -25,7 +25,7 @@ if (PdoGzipCacheEnable == true) {
|
||||
if (self::$init) {
|
||||
$this->getConnection();
|
||||
}
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
parent::setUp();
|
||||
$this->smarty->setCachingType('pdo');
|
||||
$this->smarty->addPluginsDir(SMARTY_DIR . '../demo/plugins/');
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @author Uwe Tews
|
||||
*/
|
||||
if (MysqlCacheEnable == true) {
|
||||
include_once __DIR__ . '/../_shared/CacheResourceTestCommon.php';
|
||||
include_once dirname(__FILE__) . '/../_shared/CacheResourceTestCommon.php';
|
||||
|
||||
/**
|
||||
* class for cache resource file tests
|
||||
@@ -25,10 +25,10 @@ if (MysqlCacheEnable == true) {
|
||||
if (self::$init) {
|
||||
$this->getConnection();
|
||||
}
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
parent::setUp();
|
||||
if (!class_exists('Smarty_CacheResource_Mysqltest', false)) {
|
||||
require_once(__DIR__ . "/../_shared/PHPunitplugins/cacheresource.mysqltest.php");
|
||||
require_once(dirname(__FILE__) . "/../_shared/PHPunitplugins/cacheresource.mysqltest.php");
|
||||
}
|
||||
$this->smarty->setCachingType('foobar');
|
||||
$this->smarty->registerCacheResource('foobar', new Smarty_CacheResource_Mysqltest());
|
||||
|
@@ -17,8 +17,8 @@ class CacheResourceTestCommon extends PHPUnit_Smarty
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->smarty->setTemplateDir(__DIR__ . '/../_shared/templates');
|
||||
$this->smarty->addPluginsDir(__DIR__ . '/../_shared/PHPunitplugins');
|
||||
$this->smarty->setTemplateDir(dirname(__FILE__) . '/../_shared/templates');
|
||||
$this->smarty->addPluginsDir(dirname(__FILE__) . '/../_shared/PHPunitplugins');
|
||||
$this->smarty->registerFilter('pre', array($this, 'compiledPrefilter'));
|
||||
}
|
||||
|
||||
@@ -514,9 +514,9 @@ class CacheResourceTestCommon extends PHPUnit_Smarty
|
||||
{
|
||||
$this->smarty->setCaching(true);
|
||||
if ($folder == 0) {
|
||||
$this->smarty->setTemplateDir(array(__DIR__ . '/../_shared/templates', __DIR__ . '/../_shared/templates/a'));
|
||||
$this->smarty->setTemplateDir(array(dirname(__FILE__) . '/../_shared/templates', dirname(__FILE__) . '/../_shared/templates/a'));
|
||||
} else {
|
||||
$this->smarty->setTemplateDir(array(__DIR__ . '/../_shared/templates', __DIR__ . '/../_shared/templates/b'));
|
||||
$this->smarty->setTemplateDir(array(dirname(__FILE__) . '/../_shared/templates', dirname(__FILE__) . '/../_shared/templates/b'));
|
||||
}
|
||||
if ($merge) {
|
||||
$this->smarty->setCompileId(1);
|
||||
|
@@ -17,7 +17,7 @@ class CompileCompilerPluginTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
|
@@ -17,7 +17,7 @@ class DelimiterTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
|
@@ -22,7 +22,7 @@ class ConfigVarTest extends PHPUnit_Smarty
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -23,7 +23,7 @@ class DefaultConfigHandlerTest extends PHPUnit_Smarty
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smarty->setForceCompile(true);
|
||||
}
|
||||
|
||||
|
@@ -19,7 +19,7 @@ class CustomResourceAmbiguousTest extends PHPUnit_Smarty
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
require_once dirname(__FILE__) . '/PHPunitplugins/resource.ambiguous.php';
|
||||
|
||||
// empty the template dir
|
||||
|
@@ -17,7 +17,7 @@ class ResourceExtendsAllPluginTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
|
@@ -23,7 +23,7 @@ if (MysqlResourceEnable == true) {
|
||||
if (self::$init) {
|
||||
$this->getConnection();
|
||||
}
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
|
@@ -17,7 +17,7 @@ class DefaultTemplateHandlerTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smarty->setForceCompile(true);
|
||||
$this->smarty->disableSecurity();
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ class EvalResourceTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class ExtendsResourceTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class FileResourceTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
|
@@ -13,12 +13,12 @@ class FileIncludePathTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smarty->use_include_path = true;
|
||||
$this->smarty->setTemplateDir(array('./templates', './templates_2', './include'));
|
||||
$this->smarty->enableSecurity();
|
||||
$ds = DS;
|
||||
set_include_path($this->smarty->_realpath(__DIR__ . "{$ds}..{$ds}..{$ds}..{$ds}Include_Path{$ds}Tpl{$ds}", true) . PATH_SEPARATOR . get_include_path());
|
||||
set_include_path($this->smarty->_realpath(dirname(__FILE__) . "{$ds}..{$ds}..{$ds}..{$ds}Include_Path{$ds}Tpl{$ds}", true) . PATH_SEPARATOR . get_include_path());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -13,11 +13,11 @@ class FileResourceIndexedTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->smarty->addTemplateDir(__DIR__ . '/templates_2');
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smarty->addTemplateDir(dirname(__FILE__) . '/templates_2');
|
||||
// note that 10 is a string!
|
||||
$this->smarty->addTemplateDir(__DIR__ . '/templates_3', '10');
|
||||
$this->smarty->addTemplateDir(__DIR__ . '/templates_4', 'foo');
|
||||
$this->smarty->addTemplateDir(dirname(__FILE__) . '/templates_3', '10');
|
||||
$this->smarty->addTemplateDir(dirname(__FILE__) . '/templates_4', 'foo');
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
|
@@ -17,7 +17,7 @@ class PhpResourceTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -18,7 +18,7 @@ class RegisteredResourceTest extends PHPUnit_Smarty
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
|
||||
$this->smarty->registerResource("rr", array("rr_get_template",
|
||||
"rr_get_timestamp",
|
||||
|
@@ -17,7 +17,7 @@ class ResourcePluginTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
|
@@ -17,7 +17,7 @@ class StreamResourceTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
|
||||
$this->smarty->assign('foo', 'bar');
|
||||
stream_wrapper_register("global", "ResourceStream")
|
||||
|
@@ -17,7 +17,7 @@ class StringResourceTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class FunctionTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
|
@@ -18,7 +18,7 @@ class SecurityTest extends PHPUnit_Smarty
|
||||
public $loadSmartyBC = true;
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
|
||||
$this->smarty->setForceCompile(true);
|
||||
$this->smarty->enableSecurity();
|
||||
@@ -280,12 +280,12 @@ class SecurityTest extends PHPUnit_Smarty
|
||||
*/
|
||||
public function testNotTrustedDirectory()
|
||||
{
|
||||
$this->smarty->security_policy->secure_dir = array(str_replace('\\', '/', __DIR__ . '/templates_3/'));
|
||||
$this->smarty->security_policy->secure_dir = array(str_replace('\\', '/', dirname(__FILE__) . '/templates_3/'));
|
||||
try {
|
||||
$this->smarty->fetch('eval:{include file="templates_2/hello.tpl"}');
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$this->assertContains(str_replace('\\', '/', __DIR__ . "/templates_2/hello.tpl' not allowed by security setting"), str_replace('\\', '/', $e->getMessage()));
|
||||
$this->assertContains(str_replace('\\', '/', dirname(__FILE__) . "/templates_2/hello.tpl' not allowed by security setting"), str_replace('\\', '/', $e->getMessage()));
|
||||
|
||||
return;
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ class AppendTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -19,7 +19,7 @@ class AppendByRefBCTest extends PHPUnit_Smarty
|
||||
public $loadSmarty = false;
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
|
@@ -17,7 +17,7 @@ class AppendByRefTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -17,7 +17,7 @@ class AssignTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -19,7 +19,7 @@ class AssignByRefBCTest extends PHPUnit_Smarty
|
||||
public $loadSmarty = false;
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class AssignByRefTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -17,7 +17,7 @@ class AssignGlobalTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -22,7 +22,7 @@ class ClearAllAssignBCTest extends PHPUnit_Smarty
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
|
||||
$this->smartyBC->assign('foo', 'foo');
|
||||
$this->_dataBC = new Smarty_Data($this->smartyBC);
|
||||
|
@@ -20,7 +20,7 @@ class ClearAllAssignTest extends PHPUnit_Smarty
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
|
||||
$this->smarty->assign('foo', 'foo');
|
||||
$this->_data = new Smarty_Data($this->smarty);
|
||||
|
@@ -19,7 +19,7 @@ class ClearAssignBCTest extends PHPUnit_Smarty
|
||||
public $loadSmarty = false;
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
|
||||
$this->smartyBC->assign('foo', 'foo');
|
||||
$this->smartyBC->assign('bar', 'bar');
|
||||
|
@@ -17,7 +17,7 @@ class ClearAssignTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smarty->assign('foo', 'foo');
|
||||
$this->smarty->assign('bar', 'bar');
|
||||
$this->smarty->assign('blar', 'blar');
|
||||
|
@@ -21,7 +21,7 @@ class ClearCompiledBCTest extends PHPUnit_Smarty
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smartyBC->addTemplateDir('./templates_2/');
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,7 @@ class ClearCompiledTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smarty->addTemplateDir('./templates_2/');
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ class get_template_varsBCTest extends PHPUnit_Smarty
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class GetTemplateVarsTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -18,7 +18,7 @@ class RegisterBlockTest extends PHPUnit_Smarty
|
||||
public $loadSmartyBC = true;
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smarty->disableSecurity();
|
||||
$this->smartyBC->disableSecurity();
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ class RegisterCompilerFunctionBCTest extends PHPUnit_Smarty
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class RegisterCompilerFunctionTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -22,7 +22,7 @@ class RegisterFunctionBCTest extends PHPUnit_Smarty
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
|
@@ -18,7 +18,7 @@ class RegisterFunctionTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
|
@@ -17,7 +17,7 @@ class RegisterModifierTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class CompileRegisteredObjectFunctionTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
|
||||
$this->smarty->setForceCompile(true);
|
||||
$this->smarty->disableSecurity();
|
||||
|
@@ -17,7 +17,7 @@ class TemplateExistsTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class CommentsTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
|
@@ -17,7 +17,7 @@ class SpacingTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smarty->assign('foo', 'bar');
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class StaticClassAccessTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smarty->disableSecurity();
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class CompileAppendTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class CompileAssignTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
|
@@ -17,7 +17,7 @@ class CompileBlockPluginTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smarty->addPluginsDir("./PHPunitplugins/");
|
||||
$this->smarty->setForceCompile(true);
|
||||
$this->smarty->disableSecurity();
|
||||
|
@@ -17,7 +17,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
//$this->smarty->setMergeCompiledIncludes(true);
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class CompileCaptureTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class CompilerPluginTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -22,7 +22,7 @@ class CompileConfigLoadTest extends PHPUnit_Smarty
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -17,7 +17,7 @@ class CompileDelimiterTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class CompileEvalTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class CompileForTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class CompileForeachTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
//$this->smarty->force_compile = true;
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class CompileFunctionPluginTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
|
@@ -17,7 +17,7 @@ class CompileIfTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class CompileIncludeTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -19,7 +19,7 @@ class CompileIncludePhpTest extends PHPUnit_Smarty
|
||||
public $loadSmarty = false;
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smartyBC->setForceCompile(true);
|
||||
}
|
||||
|
||||
|
@@ -17,8 +17,8 @@ class CompileInsertTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->smarty->addPluginsDir(__DIR__ . "/PHPunitplugins/");
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smarty->addPluginsDir(dirname(__FILE__) . "/PHPunitplugins/");
|
||||
$this->smarty->enableSecurity();
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ class CompileInsertTest extends PHPUnit_Smarty
|
||||
*/
|
||||
public function testInsertPluginCaching1_2()
|
||||
{
|
||||
$this->smarty->addPluginsDir(__DIR__ . "/PHPunitplugins/");
|
||||
$this->smarty->addPluginsDir(dirname(__FILE__) . "/PHPunitplugins/");
|
||||
global $insertglobal;
|
||||
$insertglobal = 'changed global 2';
|
||||
$this->smarty->caching = 1;
|
||||
@@ -113,7 +113,7 @@ class CompileInsertTest extends PHPUnit_Smarty
|
||||
*/
|
||||
public function testInsertPluginCaching1_3()
|
||||
{
|
||||
$this->smarty->addPluginsDir(__DIR__ . "/PHPunitplugins/");
|
||||
$this->smarty->addPluginsDir(dirname(__FILE__) . "/PHPunitplugins/");
|
||||
global $insertglobal;
|
||||
$insertglobal = 'changed global';
|
||||
$this->smarty->caching = 1;
|
||||
@@ -131,7 +131,7 @@ class CompileInsertTest extends PHPUnit_Smarty
|
||||
public function testInsertPluginCaching1_4()
|
||||
{
|
||||
global $insertglobal;
|
||||
$this->smarty->addPluginsDir(__DIR__ . "/PHPunitplugins/");
|
||||
$this->smarty->addPluginsDir(dirname(__FILE__) . "/PHPunitplugins/");
|
||||
if (true) { //disabled
|
||||
$insertglobal = 'changed global 4';
|
||||
$this->smarty->caching = 1;
|
||||
|
@@ -17,7 +17,7 @@ class LiteralTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class CompileNocacheTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -18,7 +18,7 @@ class CompilePhpTest extends PHPUnit_Smarty
|
||||
public $loadSmartyBC = true;
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->smartyBC->disableSecurity();
|
||||
$this->smarty->disableSecurity();
|
||||
$this->smarty->setCompileId($this->getName());
|
||||
|
@@ -19,7 +19,7 @@ class PluginBlockTextformatTest extends PHPUnit_Smarty
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testDefault()
|
||||
|
@@ -17,7 +17,7 @@ class PluginFunctionFetchTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testTodo()
|
||||
|
@@ -19,7 +19,7 @@ class PluginFunctionHtmlCheckboxesTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testAssociativeArray()
|
||||
|
@@ -17,7 +17,7 @@ class PluginFunctionHtmlImageTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testFoo()
|
||||
|
@@ -19,7 +19,7 @@ class PluginFunctionHtmlOptionsTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testAssociativeArray()
|
||||
|
@@ -18,7 +18,7 @@ class PluginFunctionHtmlRadiosTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
}
|
||||
|
||||
public function testAssociativeArray()
|
||||
|
@@ -209,7 +209,7 @@ class PluginFunctionHtmlSelectDateTest extends PHPUnit_Smarty
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
|
||||
$year = date('Y');
|
||||
$this->now = mktime(15, 0, 0, 2, 20, $year);
|
||||
|
@@ -17,7 +17,7 @@ class PluginFunctionHtmlSelectTimeTest extends PHPUnit_Smarty
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setUpSmarty(__DIR__);
|
||||
$this->setUpSmarty(dirname(__FILE__));
|
||||
$this->now = mktime(16, 15, 11, 2, 20, 2011);
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user