mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
Update
This commit is contained in:
@@ -7,13 +7,14 @@
|
|||||||
* Smarty PHPUnit Bootstrap
|
* Smarty PHPUnit Bootstrap
|
||||||
*/
|
*/
|
||||||
// Locate SmartyBC class and load it
|
// Locate SmartyBC class and load it
|
||||||
if (is_file(__DIR__ . '/../smarty/libs/SmartyBC.class.php')) {
|
if (is_file(__DIR__ . '/../smarty/libs/Autoloader.php')) {
|
||||||
require_once __DIR__ . '/../smarty/libs/SmartyBC.class.php';
|
require_once __DIR__ . '/../smarty/libs/Autoloader.php';
|
||||||
} elseif (is_file(__DIR__ . '/../libs/SmartyBC.class.php')) {
|
} elseif (is_file(__DIR__ . '/../libs/Autoloader.php')) {
|
||||||
require_once __DIR__ . '/../libs/SmartyBC.class.php';
|
require_once __DIR__ . '/../libs/Autoloader.php';
|
||||||
} else {
|
} else {
|
||||||
throw new Exception('can not locate Smarty distribution');
|
throw new Exception('can not locate Smarty distribution');
|
||||||
}
|
}
|
||||||
|
Smarty_Autoloader::register(true);
|
||||||
if (!defined('SMARTY_COMPOSER_INSTALL')) {
|
if (!defined('SMARTY_COMPOSER_INSTALL')) {
|
||||||
foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php') as $file) {
|
foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php') as $file) {
|
||||||
if (file_exists($file)) {
|
if (file_exists($file)) {
|
||||||
@@ -26,7 +27,11 @@ if (!defined('SMARTY_COMPOSER_INSTALL')) {
|
|||||||
if (!class_exists('PHPUnit_Framework_TestCase')) {
|
if (!class_exists('PHPUnit_Framework_TestCase')) {
|
||||||
require_once SMARTY_COMPOSER_INSTALL;
|
require_once SMARTY_COMPOSER_INSTALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once 'PHPUnit_Smarty.php';
|
require_once 'PHPUnit_Smarty.php';
|
||||||
ini_set('date.timezone', 'UTC');
|
if (!ini_get('date.timezone')) {
|
||||||
|
ini_set('date.timezone', 'UTC');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -82,16 +82,7 @@ class PHPUnit_Smarty extends PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
error_reporting(E_ALL | E_STRICT);
|
error_reporting(E_ALL | E_STRICT);
|
||||||
self::$init = true;
|
self::$init = true;
|
||||||
//self::$pdo = null;
|
}
|
||||||
if (self::$config == null) {
|
|
||||||
$xml = simplexml_load_file(__DIR__ . '/config.xml');
|
|
||||||
$json_string = json_encode($xml);
|
|
||||||
self::$config = json_decode($json_string, true);
|
|
||||||
if (empty(self::$config['mysql']['DB_PASSWD'])) {
|
|
||||||
self::$config['mysql']['DB_PASSWD'] = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called after the last test of this test class is run.
|
* This method is called after the last test of this test class is run.
|
||||||
@@ -133,7 +124,7 @@ class PHPUnit_Smarty extends PHPUnit_Framework_TestCase
|
|||||||
if (!is_dir($dir . '/configs')) {
|
if (!is_dir($dir . '/configs')) {
|
||||||
mkdir($dir . '/configs');
|
mkdir($dir . '/configs');
|
||||||
}
|
}
|
||||||
if (self::$config['individualFolders'] != 'true') {
|
if (individualFolders != 'true') {
|
||||||
$dir = __DIR__;
|
$dir = __DIR__;
|
||||||
}
|
}
|
||||||
if (!is_dir($dir . '/templates_c')) {
|
if (!is_dir($dir . '/templates_c')) {
|
||||||
@@ -150,7 +141,7 @@ class PHPUnit_Smarty extends PHPUnit_Framework_TestCase
|
|||||||
// instance Smarty class
|
// instance Smarty class
|
||||||
if ($this->loadSmarty) {
|
if ($this->loadSmarty) {
|
||||||
$this->smarty = new Smarty;
|
$this->smarty = new Smarty;
|
||||||
if (self::$config['individualFolders'] != 'true') {
|
if (individualFolders != 'true') {
|
||||||
$this->smarty->setCompileDir(__DIR__ . '/templates_c');
|
$this->smarty->setCompileDir(__DIR__ . '/templates_c');
|
||||||
$this->smarty->setCacheDir(__DIR__ . '/cache');
|
$this->smarty->setCacheDir(__DIR__ . '/cache');
|
||||||
}
|
}
|
||||||
@@ -158,7 +149,7 @@ class PHPUnit_Smarty extends PHPUnit_Framework_TestCase
|
|||||||
// instance SmartyBC class
|
// instance SmartyBC class
|
||||||
if ($this->loadSmartyBC) {
|
if ($this->loadSmartyBC) {
|
||||||
$this->smartyBC = new SmartyBC;
|
$this->smartyBC = new SmartyBC;
|
||||||
if (self::$config['individualFolders'] != 'true') {
|
if (individualFolders != 'true') {
|
||||||
$this->smartyBC->setCompileDir(__DIR__ . '/templates_c');
|
$this->smartyBC->setCompileDir(__DIR__ . '/templates_c');
|
||||||
$this->smartyBC->setCacheDir(__DIR__ . '/cache');
|
$this->smartyBC->setCacheDir(__DIR__ . '/cache');
|
||||||
}
|
}
|
||||||
@@ -173,7 +164,7 @@ class PHPUnit_Smarty extends PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
if (PHPUnit_Smarty::$pdo == null) {
|
if (PHPUnit_Smarty::$pdo == null) {
|
||||||
try {
|
try {
|
||||||
PHPUnit_Smarty::$pdo = new PDO(self::$config['mysql']['DB_DSN'], self::$config['mysql']['DB_USER'], self::$config['mysql']['DB_PASSWD']);
|
PHPUnit_Smarty::$pdo = new PDO(DB_DSN, DB_USER, DB_PASSWD);
|
||||||
}
|
}
|
||||||
catch (PDOException $e) {
|
catch (PDOException $e) {
|
||||||
throw new SmartyException('Mysql Resource failed: ' . $e->getMessage());
|
throw new SmartyException('Mysql Resource failed: ' . $e->getMessage());
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Smarty PHPunit tests for cache resource file
|
* Smarty PHPunit tests for cache resource Apc
|
||||||
*
|
*
|
||||||
* @package PHPunit
|
* @package PHPunit
|
||||||
* @author Uwe Tews
|
* @author Uwe Tews
|
||||||
@@ -15,9 +15,9 @@ include_once __DIR__ . '/../Memcache/CacheResourceCustomMemcacheTest.php';
|
|||||||
*/
|
*/
|
||||||
class CacheResourceCustomApcTest extends CacheResourceCustomMemcacheTest
|
class CacheResourceCustomApcTest extends CacheResourceCustomMemcacheTest
|
||||||
{
|
{
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
if (self::$config['cacheResource']['ApcEnable'] != 'true') {
|
if (ApcCacheEnable != true) {
|
||||||
$this->markTestSkipped('Apc tests are disabled');
|
$this->markTestSkipped('Apc tests are disabled');
|
||||||
} else {
|
} else {
|
||||||
if (!function_exists('apc_cache_info') || ini_get('apc.enable_cli')) {
|
if (!function_exists('apc_cache_info') || ini_get('apc.enable_cli')) {
|
||||||
@@ -30,3 +30,4 @@ class CacheResourceCustomApcTest extends CacheResourceCustomMemcacheTest
|
|||||||
$this->smarty->addPluginsDir(SMARTY_DIR . '../demo/plugins/');
|
$this->smarty->addPluginsDir(SMARTY_DIR . '../demo/plugins/');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -22,7 +22,7 @@ class CacheResourceCustomMemcacheTest extends CacheResourceTestCommon
|
|||||||
*/
|
*/
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
if (self::$config['cacheResource']['MemcacheEnable'] != 'true') {
|
if (MemCacheEnable != true) {
|
||||||
$this->markTestSkipped('Memcache tests are disabled');
|
$this->markTestSkipped('Memcache tests are disabled');
|
||||||
} else {
|
} else {
|
||||||
if (!class_exists('Memcache')) {
|
if (!class_exists('Memcache')) {
|
||||||
@@ -34,7 +34,6 @@ class CacheResourceCustomMemcacheTest extends CacheResourceTestCommon
|
|||||||
$this->smarty->setCachingType('memcachetest');
|
$this->smarty->setCachingType('memcachetest');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testInit()
|
public function testInit()
|
||||||
{
|
{
|
||||||
$this->cleanDirs();
|
$this->cleanDirs();
|
||||||
|
@@ -1,12 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Smarty PHPunit tests for cache resource file
|
* Smarty PHPunit tests for cache resource mysql
|
||||||
*
|
*
|
||||||
* @package PHPunit
|
* @package PHPunit
|
||||||
* @author Uwe Tews
|
* @author Uwe Tews
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once __DIR__ . '/../_shared/CacheResourceTestCommon.php';
|
include_once __DIR__ . '/../_shared/CacheResourceTestCommon.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class for cache resource file tests
|
* class for cache resource file tests
|
||||||
*
|
*
|
||||||
@@ -17,7 +18,7 @@ class CacheResourceCustomMysqlTest extends CacheResourceTestCommon
|
|||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
if (self::$config['cacheResource']['MysqlEnable'] != 'true') {
|
if (MysqlCacheEnable != true) {
|
||||||
$this->markTestSkipped('mysql tests are disabled');
|
$this->markTestSkipped('mysql tests are disabled');
|
||||||
}
|
}
|
||||||
if (self::$init) {
|
if (self::$init) {
|
||||||
@@ -34,3 +35,4 @@ class CacheResourceCustomMysqlTest extends CacheResourceTestCommon
|
|||||||
$this->initMysqlCache();
|
$this->initMysqlCache();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Smarty PHPunit tests for cache resource file
|
* Smarty PHPunit tests for cache resource Pdo
|
||||||
*
|
*
|
||||||
* @package PHPunit
|
* @package PHPunit
|
||||||
* @author Uwe Tews
|
* @author Uwe Tews
|
||||||
@@ -18,7 +18,7 @@ class CacheResourceCustomPDOTest extends CacheResourceTestCommon
|
|||||||
|
|
||||||
public function setUp($dir = null, $clear = true)
|
public function setUp($dir = null, $clear = true)
|
||||||
{
|
{
|
||||||
if (self::$config['cacheResource']['PdoEnable'] != 'true') {
|
if (PdoCacheEnable != true) {
|
||||||
$this->markTestSkipped('mysql Pdo tests are disabled');
|
$this->markTestSkipped('mysql Pdo tests are disabled');
|
||||||
}
|
}
|
||||||
if (self::$init) {
|
if (self::$init) {
|
||||||
@@ -38,3 +38,4 @@ class CacheResourceCustomPDOTest extends CacheResourceTestCommon
|
|||||||
$this->initMysqlCache();
|
$this->initMysqlCache();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@ class CacheResourceCustomPDOGzipTest extends CacheResourceTestCommon
|
|||||||
|
|
||||||
public function setUp($dir = null, $clear = true)
|
public function setUp($dir = null, $clear = true)
|
||||||
{
|
{
|
||||||
if (self::$config['cacheResource']['PdoGzipEnable'] != 'true') {
|
if (PdoGzipCacheEnable != truw) {
|
||||||
$this->markTestSkipped('mysql Pdo Gzip tests are disabled');
|
$this->markTestSkipped('mysql Pdo Gzip tests are disabled');
|
||||||
}
|
}
|
||||||
if (self::$init) {
|
if (self::$init) {
|
||||||
@@ -38,3 +38,4 @@ class CacheResourceCustomPDOGzipTest extends CacheResourceTestCommon
|
|||||||
$this->initMysqlCache();
|
$this->initMysqlCache();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Smarty PHPunit tests for cache resource file
|
* Smarty PHPunit tests for cache resource registered
|
||||||
*
|
*
|
||||||
* @package PHPunit
|
* @package PHPunit
|
||||||
* @author Uwe Tews
|
* @author Uwe Tews
|
||||||
@@ -16,7 +16,7 @@ class CacheResourceCustomRegisteredTest extends CacheResourceTestCommon
|
|||||||
{
|
{
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
if (self::$config['cacheResource']['MysqlEnable'] != 'true') {
|
if (MysqlCacheEnable != true) {
|
||||||
$this->markTestSkipped('mysql tests are disabled');
|
$this->markTestSkipped('mysql tests are disabled');
|
||||||
}
|
}
|
||||||
if (self::$init) {
|
if (self::$init) {
|
||||||
@@ -37,3 +37,4 @@ class CacheResourceCustomRegisteredTest extends CacheResourceTestCommon
|
|||||||
$this->initMysqlCache();
|
$this->initMysqlCache();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,89 +5,83 @@
|
|||||||
* @package PHPunit
|
* @package PHPunit
|
||||||
* @author Uwe Tews
|
* @author Uwe Tews
|
||||||
*/
|
*/
|
||||||
|
if (defined(MysqlResourceEnable) && MysqlResourceEnable == 'true') {
|
||||||
/**
|
/**
|
||||||
* class for resource plugins tests
|
* class for resource plugins tests
|
||||||
*
|
*
|
||||||
* @backupStaticAttributes enabled
|
* @backupStaticAttributes enabled
|
||||||
*/
|
*/
|
||||||
class ResourceMysqlPluginTest extends PHPUnit_Smarty
|
class ResourceMysqlPluginTest extends PHPUnit_Smarty
|
||||||
{
|
|
||||||
public function setUp()
|
|
||||||
{
|
{
|
||||||
if (self::$config['resource']['MysqlEnable'] != 'true') {
|
public function setUp()
|
||||||
$this->markTestSkipped('mysql tests are disabled');
|
{
|
||||||
|
if (self::$init) {
|
||||||
|
$this->getConnection();
|
||||||
|
}
|
||||||
|
$this->setUpSmarty(__DIR__);
|
||||||
}
|
}
|
||||||
if (self::$init) {
|
|
||||||
$this->getConnection();
|
public function testInit()
|
||||||
|
{
|
||||||
|
$this->cleanDirs();
|
||||||
|
$this->initMysqlResource();
|
||||||
|
PHPUnit_Smarty::$pdo->exec("REPLACE INTO templates VALUES ('test.tpl', '2010-12-25 22:00:00', '{\$x = \'hello world\'}{\$x}' )");
|
||||||
}
|
}
|
||||||
$this->setUpSmarty(__DIR__);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test resource plugin rendering of a custom resource
|
||||||
|
*/
|
||||||
|
public function testResourcePluginMysql()
|
||||||
|
{
|
||||||
|
//$this->smarty->addPluginsDir(SMARTY_DIR . "../demo/plugins/");
|
||||||
|
$this->smarty->addPluginsDir("./PHPunitplugins/");
|
||||||
|
$this->assertEquals('hello world', $this->smarty->fetch('mysqltest:test.tpl'));
|
||||||
|
}
|
||||||
|
|
||||||
public function testInit()
|
/**
|
||||||
{
|
* test resource plugin timestamp of a custom resource
|
||||||
$this->cleanDirs();
|
*/
|
||||||
$this->initMysqlResource();
|
public function testResourcePluginMysqlTimestamp()
|
||||||
PHPUnit_Smarty::$pdo->exec("REPLACE INTO templates VALUES ('test.tpl', '2010-12-25 22:00:00', '{\$x = \'hello world\'}{\$x}' )");
|
{
|
||||||
}
|
// $this->smarty->addPluginsDir(SMARTY_DIR . "../demo/plugins/");
|
||||||
|
$this->smarty->addPluginsDir("./PHPunitplugins/");
|
||||||
|
$tpl = $this->smarty->createTemplate('mysqltest:test.tpl');
|
||||||
|
$this->assertEquals(strtotime("2010-12-25 22:00:00"), $tpl->source->timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test resource plugin rendering of a custom resource
|
* test resource plugin compiledFilepath of a custom resource
|
||||||
*/
|
*/
|
||||||
public function testResourcePluginMysql()
|
public function testResourcePluginMysqlCompiledFilepath()
|
||||||
{
|
{
|
||||||
//$this->smarty->addPluginsDir(SMARTY_DIR . "../demo/plugins/");
|
// $this->smarty->addPluginsDir(SMARTY_DIR . "../demo/plugins/");
|
||||||
$this->smarty->addPluginsDir("./PHPunitplugins/");
|
$this->smarty->addPluginsDir("./PHPunitplugins/");
|
||||||
$this->assertEquals('hello world', $this->smarty->fetch('mysqltest:test.tpl'));
|
$tpl = $this->smarty->createTemplate('mysqltest:test.tpl');
|
||||||
}
|
$this->assertEquals($this->buildCompiledPath($tpl, false, false, null, 'test.tpl', 'mysqltest', $this->smarty->getTemplateDir(0)), $tpl->compiled->filepath);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
public function testResourcePluginMysqlCompiledFilepathCache()
|
||||||
* test resource plugin timestamp of a custom resource
|
{
|
||||||
*/
|
//$this->smarty->addPluginsDir(SMARTY_DIR . "../demo/plugins/");
|
||||||
public function testResourcePluginMysqlTimestamp()
|
$this->smarty->addPluginsDir("./PHPunitplugins/");
|
||||||
{
|
$this->smarty->caching = true;
|
||||||
// $this->smarty->addPluginsDir(SMARTY_DIR . "../demo/plugins/");
|
$this->smarty->cache_lifetime = 1000;
|
||||||
$this->smarty->addPluginsDir("./PHPunitplugins/");
|
$this->smarty->setForceCompile(true);
|
||||||
$tpl = $this->smarty->createTemplate('mysqltest:test.tpl');
|
$this->smarty->fetch('mysqltest:test.tpl');
|
||||||
$this->assertEquals(strtotime("2010-12-25 22:00:00"), $tpl->source->timestamp);
|
$tpl = $this->smarty->createTemplate('mysqltest:test.tpl');
|
||||||
}
|
$this->assertEquals($this->buildCompiledPath($tpl, false, true, null, 'test.tpl', 'mysqltest', $this->smarty->getTemplateDir(0)), $tpl->compiled->filepath);
|
||||||
|
$this->smarty->caching = false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test resource plugin compiledFilepath of a custom resource
|
* test resource plugin timestamp of a custom resource with only fetch() implemented
|
||||||
*/
|
*/
|
||||||
public function testResourcePluginMysqlCompiledFilepath()
|
public function testResourcePluginMysqlTimestampWithoutFetchTimestamp()
|
||||||
{
|
{
|
||||||
// $this->smarty->addPluginsDir(SMARTY_DIR . "../demo/plugins/");
|
// $this->smarty->addPluginsDir(SMARTY_DIR . "../demo/plugins/");
|
||||||
$this->smarty->addPluginsDir("./PHPunitplugins/");
|
$this->smarty->addPluginsDir("./PHPunitplugins/");
|
||||||
$tpl = $this->smarty->createTemplate('mysqltest:test.tpl');
|
$tpl = $this->smarty->createTemplate('mysqlstest:test.tpl');
|
||||||
$this->assertEquals($this->buildCompiledPath($tpl, false, false, null, 'test.tpl', 'mysqltest', $this->smarty->getTemplateDir(0))
|
$this->assertEquals(strtotime("2010-12-25 22:00:00"), $tpl->source->timestamp);
|
||||||
, $tpl->compiled->filepath
|
}
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public function testResourcePluginMysqlCompiledFilepathCache()
|
|
||||||
{
|
|
||||||
//$this->smarty->addPluginsDir(SMARTY_DIR . "../demo/plugins/");
|
|
||||||
$this->smarty->addPluginsDir("./PHPunitplugins/");
|
|
||||||
$this->smarty->caching = true;
|
|
||||||
$this->smarty->cache_lifetime = 1000;
|
|
||||||
$this->smarty->setForceCompile(true);
|
|
||||||
$this->smarty->fetch('mysqltest:test.tpl');
|
|
||||||
$tpl = $this->smarty->createTemplate('mysqltest:test.tpl');
|
|
||||||
$this->assertEquals($this->buildCompiledPath($tpl, false, true, null, 'test.tpl', 'mysqltest', $this->smarty->getTemplateDir(0))
|
|
||||||
, $tpl->compiled->filepath
|
|
||||||
);
|
|
||||||
$this->smarty->caching = false;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* test resource plugin timestamp of a custom resource with only fetch() implemented
|
|
||||||
*/
|
|
||||||
public function testResourcePluginMysqlTimestampWithoutFetchTimestamp()
|
|
||||||
{
|
|
||||||
// $this->smarty->addPluginsDir(SMARTY_DIR . "../demo/plugins/");
|
|
||||||
$this->smarty->addPluginsDir("./PHPunitplugins/");
|
|
||||||
$tpl = $this->smarty->createTemplate('mysqlstest:test.tpl');
|
|
||||||
$this->assertEquals(strtotime("2010-12-25 22:00:00"), $tpl->source->timestamp);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -15,20 +15,20 @@ class ResourcePluginTest extends PHPUnit_Smarty
|
|||||||
{
|
{
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
if (self::$config['cacheResource']['MysqlEnable'] != 'true') {
|
if (MysqlResourceEnable != true) {
|
||||||
$this->markTestSkipped('mysql tests are disabled');
|
$this->markTestSkipped('mysql tests are disabled');
|
||||||
}
|
}
|
||||||
if (self::$init) {
|
if (self::$init) {
|
||||||
$this->getConnection();
|
$this->getConnection();
|
||||||
}
|
}
|
||||||
$this->setUpSmarty(__DIR__);
|
$this->setUpSmarty(__DIR__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testInit()
|
public function testInit()
|
||||||
{
|
{
|
||||||
$this->cleanDirs();
|
$this->cleanDirs();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test resource plugin rendering
|
* test resource plugin rendering
|
||||||
*/
|
*/
|
||||||
@@ -58,7 +58,6 @@ class ResourcePluginTest extends PHPUnit_Smarty
|
|||||||
$this->assertEquals('hello world', $this->smarty->fetch('db2a:test'));
|
$this->assertEquals('hello world', $this->smarty->fetch('db2a:test'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test resource plugin non-existent compiled cache of a recompiling resource
|
* test resource plugin non-existent compiled cache of a recompiling resource
|
||||||
*/
|
*/
|
||||||
@@ -71,7 +70,6 @@ class ResourcePluginTest extends PHPUnit_Smarty
|
|||||||
$this->assertFalse($tpl->compiled->filepath);
|
$this->assertFalse($tpl->compiled->filepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test resource plugin timestamp
|
* test resource plugin timestamp
|
||||||
*/
|
*/
|
||||||
@@ -82,5 +80,5 @@ class ResourcePluginTest extends PHPUnit_Smarty
|
|||||||
$this->assertTrue(is_integer($tpl->source->timestamp));
|
$this->assertTrue(is_integer($tpl->source->timestamp));
|
||||||
$this->assertEquals(10, strlen($tpl->source->timestamp));
|
$this->assertEquals(10, strlen($tpl->source->timestamp));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
@@ -292,8 +292,8 @@ public function testPHP_REMOVE_php()
|
|||||||
*/
|
*/
|
||||||
public function testPHP_Tag_Literal()
|
public function testPHP_Tag_Literal()
|
||||||
{
|
{
|
||||||
$content = $this->smartyBC->fetch("string:aa { php} echo 'hallo'; {/php} ae");
|
$content = $this->smartyBC->fetch("string:aa { php} echo 'hallo'; { /php} ae");
|
||||||
$this->assertEquals('aa { php} echo \'hallo\'; {/php} ae', $content);
|
$this->assertEquals('aa { php} echo \'hallo\'; { /php} ae', $content);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* test unmatched {php} tag
|
* test unmatched {php} tag
|
||||||
|
@@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<config>
|
|
||||||
<individualFolders>true</individualFolders>
|
|
||||||
<cacheResource>
|
|
||||||
<MemcacheEnable>false</MemcacheEnable>
|
|
||||||
<ApcEnable>false</ApcEnable>
|
|
||||||
<MysqlEnable>false</MysqlEnable>
|
|
||||||
<PdoEnable>false</PdoEnable>
|
|
||||||
<PdoGzipEnable>false</PdoGzipEnable>
|
|
||||||
</cacheResource>
|
|
||||||
<resource>
|
|
||||||
<MysqlEnable>false</MysqlEnable>
|
|
||||||
</resource>
|
|
||||||
<mysql>
|
|
||||||
<DB_DSN>mysql:dbname=test;host=localhost</DB_DSN>
|
|
||||||
<DB_USER>smarty</DB_USER>
|
|
||||||
<DB_PASSWD></DB_PASSWD>
|
|
||||||
</mysql>
|
|
||||||
</config>
|
|
@@ -9,6 +9,19 @@
|
|||||||
beStrictAboutOutputDuringTests="true"
|
beStrictAboutOutputDuringTests="true"
|
||||||
stopOnFailure="false">
|
stopOnFailure="false">
|
||||||
|
|
||||||
|
<php>
|
||||||
|
<const name="individualFolders" value="true"/>
|
||||||
|
<const name="MemCacheEnable" value="false"/>
|
||||||
|
<const name="ApcCacheEnable" value="false"/>
|
||||||
|
<const name="MysqlCacheEnable" value="false"/>
|
||||||
|
<const name="PdoCacheEnable" value="false"/>
|
||||||
|
<const name="PdoGzipCacheEnable" value="false"/>
|
||||||
|
<const name="MysqlResourceEnable" value="false"/>
|
||||||
|
<const name="DB_DSN" value="mysql:dbname=test;host=localhost"/>
|
||||||
|
<const name="DB_USER" value="smarty"/>
|
||||||
|
<const name="DB_PASSWD" value=""/>
|
||||||
|
</php>
|
||||||
|
|
||||||
<filter>
|
<filter>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Smarty Test Suite">
|
<testsuite name="Smarty Test Suite">
|
||||||
|
Reference in New Issue
Block a user