summaryrefslogtreecommitdiff
path: root/tests/UnitTests/CacheResourceTests/PDO/CacheResourceCustomPDOTest.php
blob: 2a372450ea5c686556ebab7fb85ee635a1899ca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
 * Smarty PHPunit tests for cache resource Pdo
 *

 * @author  Uwe Tews
 */

include_once __DIR__ . '/../_shared/CacheResourceTestCommon.php';
include_once __DIR__ . '/cacheresource.pdotest.php';

/**
 * class for cache resource file tests
 *
 * 
 * @preserveGlobalState    disabled
 * 
 */
class CacheResourceCustomPDOTest extends CacheResourceTestCommon
{

    public function setUp($dir = null, $clear = true): void
    {
        if (PdoCacheEnable != true) {
            $this->markTestSkipped('mysql Pdo tests are disabled');
        }
        if (self::$init) {
            $this->getConnection();
        }
        $this->setUpSmarty(__DIR__);
        parent::setUp();
        $this->smarty->registerCacheResource('pdo',
                                             new Smarty_CacheResource_Pdotest($this->getPDO(), 'output_cache'));
    }

    public function testInit()
    {
        $this->cleanDirs();
        $this->initMysqlCache();
    }
}