Completed
Push — master ( 9f316b...521c5d )
by Mehmet
02:30
created

RedisCachePersistentTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 1
cbo 2
dl 13
loc 13
rs 10

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
namespace tests;
3
4
use Soupmix\Cache as c;
5
use Redis;
6
class RedisCachePersistentTest extends AbstractTestCases
7
{
8
    protected function setUp()
9
    {
10
        $handler = new Redis();
11
        $handler->pconnect(
12
            $this->redisConfig['host'],
13
            $this->redisConfig['port'],
14
            $this->redisConfig['timeout'],
15
            $this->redisConfig['persistentId']
16
        );
17
        $handler->select($this->redisConfig['dbIndex']);
18
        $this->client = new c\RedisCache($handler);
19
        $this->client->clear();
20
    }
21
22
23
}
24