2015-05-04 03:00:52 +02:00
|
|
|
<?php
|
|
|
|
|
/**
|
2015-05-18 05:36:37 +02:00
|
|
|
* Smarty PHPunit tests for cache resource registered
|
2015-05-04 03:00:52 +02:00
|
|
|
*
|
|
|
|
|
* @package PHPunit
|
|
|
|
|
* @author Uwe Tews
|
|
|
|
|
*/
|
2015-12-30 21:14:22 +01:00
|
|
|
if (MysqlCacheEnable == true) {
|
2015-12-31 05:36:00 +01:00
|
|
|
include_once dirname(__FILE__) . '/../_shared/CacheResourceTestCommon.php';
|
2015-05-04 03:00:52 +02:00
|
|
|
|
2015-12-30 21:14:22 +01:00
|
|
|
/**
|
|
|
|
|
* class for cache resource file tests
|
|
|
|
|
*
|
|
|
|
|
* @runTestsInSeparateProcess
|
|
|
|
|
* @preserveGlobalState disabled
|
|
|
|
|
* @backupStaticAttributes enabled
|
|
|
|
|
*/
|
|
|
|
|
class CacheResourceCustomRegisteredTest extends CacheResourceTestCommon
|
2015-05-04 03:00:52 +02:00
|
|
|
{
|
2015-12-30 21:14:22 +01:00
|
|
|
public function setUp()
|
|
|
|
|
{
|
|
|
|
|
if (MysqlCacheEnable != true) {
|
|
|
|
|
$this->markTestSkipped('mysql tests are disabled');
|
|
|
|
|
}
|
|
|
|
|
if (self::$init) {
|
|
|
|
|
$this->getConnection();
|
|
|
|
|
}
|
2015-12-31 05:36:00 +01:00
|
|
|
$this->setUpSmarty(dirname(__FILE__));
|
2015-12-30 21:14:22 +01:00
|
|
|
parent::setUp();
|
|
|
|
|
if (!class_exists('Smarty_CacheResource_Mysqltest', false)) {
|
2015-12-31 05:36:00 +01:00
|
|
|
require_once(dirname(__FILE__) . "/../_shared/PHPunitplugins/cacheresource.mysqltest.php");
|
2015-12-30 21:14:22 +01:00
|
|
|
}
|
|
|
|
|
$this->smarty->setCachingType('foobar');
|
|
|
|
|
$this->smarty->registerCacheResource('foobar', new Smarty_CacheResource_Mysqltest());
|
2015-05-04 03:00:52 +02:00
|
|
|
}
|
|
|
|
|
|
2015-12-30 21:14:22 +01:00
|
|
|
public function testInit()
|
|
|
|
|
{
|
|
|
|
|
$this->cleanDirs();
|
|
|
|
|
$this->initMysqlCache();
|
|
|
|
|
}
|
2015-05-04 03:00:52 +02:00
|
|
|
}
|
|
|
|
|
}
|
2015-05-18 05:36:37 +02:00
|
|
|
|