Completed
Push — sf_cache ( 0e8aea...6d5e03 )
by André
38:18 queued 11:23
created

ContentLanguageHandlerTest::getHandlerMethodName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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