Completed
Push — migrate-files-no-interaction ( 025687...608925 )
by
unknown
46:43 queued 18:48
created

IntegrationTestCacheServiceDecorator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A clearAllTestData() 0 4 1
1
<?php
2
3
/**
4
 * File containing the CacheServiceDecorator class.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Publish\Core\Persistence\Cache\Tests\Helpers;
10
11
use eZ\Publish\Core\Persistence\Cache\CacheServiceDecorator;
12
use Stash\Pool;
13
use Stash\Driver\Ephemeral;
14
15
/**
16
 * Class CacheServiceDecorator.
17
 *
18
 * Wraps the Cache Service for Spi cache to apply key prefix for the cache
19
 */
20
class IntegrationTestCacheServiceDecorator extends CacheServiceDecorator
21
{
22
    /**
23
     * Constructs the cache service decorator.
24
     */
25
    public function __construct()
26
    {
27
        $this->cachePool = new Pool(new Ephemeral());
28
    }
29
30
    /**
31
     * Private function for integration test runner to clear data between tests.
32
     */
33
    public function clearAllTestData()
34
    {
35
        $this->cachePool->clear();
36
    }
37
}
38