Completed
Push — sf_multi_get ( c68a81 )
by André
25:43 queued 12:06
created

providerForUnCachedMethods()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * File contains Test 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;
10
11
use eZ\Publish\SPI\Persistence\Content\Language as SPILanguage;
12
use eZ\Publish\SPI\Persistence\Content\Language\CreateStruct as SPILanguageCreateStruct;
13
use eZ\Publish\SPI\Persistence\Content\Language\Handler;
14
use Symfony\Component\Cache\CacheItem;
15
16
/**
17
 * Test case for Persistence\Cache\ContentLanguageHandler.
18
 */
19
class ContentLanguageHandlerTest extends AbstractCacheHandlerTest
20
{
21
    public function getHandlerMethodName() : string
22
    {
23
        return 'contentLanguageHandler';
24
    }
25
26
    public function getHandlerClassName() : string
27
    {
28
        return Handler::class;
29
    }
30
31
    public function providerForUnCachedMethods() : array
32
    {
33
        // string $method, array $arguments, array? $tags, string? $key
34
        return [
35
            ['create', [new SPILanguageCreateStruct()]],
36
            ['update', [new SPILanguage(['id' => 5])], ['language-5']],
37
            ['loadAll', []],
38
            ['delete', [5], ['language-5']],
39
40
        ];
41
    }
42
43
    public function providerForCachedLoadMethods() : array
44
    {
45
        $object = new SPILanguage(['id' => 5]);
46
47
        // string $method, array $arguments, string $key, mixed? $data
48
        return [
49
            ['load', [5], 'ez-language-5', $object],
50
            ['loadByLanguageCode', ['eng-GB'], 'ez-language-eng-GB-by-code', $object],
51
        ];
52
    }
53
}
54