-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSqliteTest.php
More file actions
executable file
·53 lines (47 loc) · 1.33 KB
/
Copy pathSqliteTest.php
File metadata and controls
executable file
·53 lines (47 loc) · 1.33 KB
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
43
44
45
46
47
48
49
50
51
52
53
<?php
include_once(Kohana::find_file('tests/cache', 'CacheBasicMethodsTest'));
/**
* @package Kohana/Cache
* @group kohana
* @group kohana.cache
* @category Test
* @author Kohana Team
* @copyright (c) 2009-2012 Kohana Team
* @license http://kohanaphp.com/license
*/
class Kohana_SqliteTest extends Kohana_CacheBasicMethodsTest {
/**
* This method MUST be implemented by each driver to setup the `Cache`
* instance for each test.
*
* This method should do the following tasks for each driver test:
*
* - Test the Cache instance driver is available, skip test otherwise
* - Setup the Cache instance
* - Call the parent setup method, `parent::setUp()`
*
* @return void
*/
public function setUp()
{
parent::setUp();
if ( ! extension_loaded('pdo_sqlite'))
{
$this->markTestSkipped('SQLite PDO PHP Extension is not available');
}
if ( ! Kohana::$config->load('cache.sqlite'))
{
Kohana::$config->load('cache')
->set(
'sqlite',
array(
'driver' => 'sqlite',
'default_expire' => 3600,
'database' => 'memory',
'schema' => 'CREATE TABLE caches(id VARCHAR(127) PRIMARY KEY, tags VARCHAR(255), expiration INTEGER, cache TEXT)',
)
);
}
$this->cache(Cache::instance('sqlite'));
}
} // End Kohana_SqliteTest