Passed
Push — master ( dba830...8c74b2 )
by Adam
02:04
created

RedisCacheTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 6
Bugs 0 Features 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 27
rs 10
c 6
b 0
f 0
1
<?php
2
namespace DBAL\Tests\Caching;
3
4
use DBAL\Caching\RedisCache;
5
6
class RedisCacheTest extends CacheTest{
7
    
8
    protected $port = 6379;
9
    
10
    /**
11
     * @covers \DBAL\Caching\RedisCache::__construct
12
     * @covers \DBAL\Caching\RedisCache::connect
13
     * @covers \DBAL\Caching\RedisCache::addServer
14
     * @covers \DBAL\Caching\RedisCache::save
15
     * @covers \DBAL\Caching\RedisCache::fetch
16
     */
17
    public function setUp() {
18
        $success = false;
19
        $this->cache = new RedisCache();
20
        $this->cache->connect('127.0.0.1', $this->port);
21
        if ($this->cache->save('test', 'Success')) {
22
            if ($this->cache->fetch('test') == 'Success') {
23
                $success = true;
24
                parent::setUp();
25
            }
26
        }
27
        if($success !== true){
28
            $this->markTestSkipped('Redis extension may not be loaded');
29
        }
30
    }
31
    
32
}
33