Completed
Push — master ( e1f38a...73ba45 )
by Marco
10s
created

SQLite3CacheTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 1
cbo 3
dl 0
loc 31
rs 10
1
<?php
2
3
namespace Doctrine\Tests\Common\Cache;
4
5
use Doctrine\Common\Cache\CacheProvider;
6
use Doctrine\Common\Cache\SQLite3Cache;
7
use SQLite3;
8
use function tempnam;
9
use function unlink;
10
11
/**
12
 * @requires extension sqlite3 >= 3
13
 */
14
class SQLite3CacheTest extends CacheTest
15
{
16
    private $file;
17
    private $sqlite;
18
19
    protected function setUp() : void
20
    {
21
        $this->file = tempnam(null, 'doctrine-cache-test-');
22
        unlink($this->file);
23
        $this->sqlite = new SQLite3($this->file);
24
    }
25
26
    protected function tearDown() : void
27
    {
28
        $this->sqlite = null;  // DB must be closed before
29
        unlink($this->file);
30
    }
31
32
    public function testGetStats() : void
33
    {
34
        self::assertNull($this->_getCacheDriver()->getStats());
35
    }
36
37
    /**
38
     * {@inheritDoc}
39
     */
40
    protected function _getCacheDriver() : CacheProvider
41
    {
42
        return new SQLite3Cache($this->sqlite, 'test_table');
43
    }
44
}
45