RedisManagerTest::testGetClient()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 17
rs 9.9
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 *  This file is part of the Micro framework package.
7
 *
8
 *  (c) Stanislau Komar <[email protected]>
9
 *
10
 *  For the full copyright and license information, please view the LICENSE
11
 *  file that was distributed with this source code.
12
 */
13
14
namespace Micro\Plugin\Cache\Test\Unit\Business\Redis;
15
16
use Micro\Plugin\Redis\Business\Redis\RedisFactoryInterface;
17
use Micro\Plugin\Redis\Business\Redis\RedisManager;
18
use Micro\Plugin\Redis\RedisPluginConfigurationInterface;
19
use PHPUnit\Framework\TestCase;
20
21
class RedisManagerTest extends TestCase
22
{
23
    public function testGetClient()
24
    {
25
        $factory = $this->createMock(RedisFactoryInterface::class);
26
        $cfg = $this->createMock(RedisPluginConfigurationInterface::class);
27
        $cfg
28
            ->expects($this->once())
29
            ->method('getClientConfiguration')
30
            ->with('test')
31
        ;
32
33
        $redisManager = new RedisManager(
34
            $factory,
35
            $cfg,
36
        );
37
38
        $redisManager->getClient('test');
39
        $redisManager->getClient('test');
40
    }
41
}
42