Passed
Branch master (f6ba96)
by Joao
03:04
created

BaseCacheTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 9

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 9
dl 0
loc 49
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Test;
4
5
use PHPUnit\Framework\TestCase;
6
7
require_once 'Model.php';
8
9
abstract class BaseCacheTest extends TestCase
10
{
11
    /**
12
     * @var \ByJG\Cache\Psr16\BaseCacheEngine
13
     */
14
    protected $cacheEngine = null;
15
16
    protected function setUp()
17
    {
18
19
    }
20
21
    protected function tearDown()
22
    {
23
        $this->cacheEngine->clear();
24
        $this->cacheEngine = null;
25
    }
26
27
    public function CachePoolProvider()
28
    {
29
        $memcachedServer = ['memcached-container:11211'];
30
        $redisCacheServer = 'redis-container:6379';
31
        $redisPassword = '';
32
33
        return [
34
            'Array'         => [
35
                new \ByJG\Cache\Psr16\ArrayCacheEngine()
36
            ],
37
            'FileSystem'    => [
38
                new \ByJG\Cache\Psr16\FileSystemCacheEngine()
39
            ],
40
            'ShmopCache'    => [
41
                new \ByJG\Cache\Psr16\ShmopCacheEngine()
42
            ],
43
            'SessionCache'  => [
44
                new \ByJG\Cache\Psr16\SessionCacheEngine()
45
            ],
46
            'NoCacheEngine' => [
47
                new \ByJG\Cache\Psr16\NoCacheEngine()
48
            ],
49
            'Memcached'     => [
50
                new \ByJG\Cache\Psr16\MemcachedEngine($memcachedServer)
51
            ],
52
            'Redis'         => [
53
                new \ByJG\Cache\Psr16\RedisCacheEngine($redisCacheServer, $redisPassword)
54
            ]
55
        ];
56
    }
57
}
58