Completed
Push — 7.0_master_link_manager_merge ( e446e3...c0b315 )
by André
15:04
created

URLHandlerTest::providerForCachedLoadMethods()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
namespace eZ\Publish\Tests\Core\Persistence\Cache;
8
9
use eZ\Publish\API\Repository\Values\URL\URLQuery;
10
use eZ\Publish\Core\Persistence\Cache\Tests\AbstractCacheHandlerTest;
11
use eZ\Publish\SPI\Persistence\URL\Handler as SpiURLHandler;
12
use eZ\Publish\SPI\Persistence\URL\URL;
13
use eZ\Publish\SPI\Persistence\URL\URLUpdateStruct;
14
15
class URLHandlerTest extends AbstractCacheHandlerTest
16
{
17
    public function getHandlerMethodName(): string
18
    {
19
        return 'urlHandler';
20
    }
21
22
    public function getHandlerClassName(): string
23
    {
24
        return SpiURLHandler::class;
25
    }
26
27
    public function providerForUnCachedMethods(): array
28
    {
29
        // string $method, array $arguments, array? $tags, string? $key
30
        return [
31
            ['find', [new URLQuery()]],
32
            ['findUsages', [1]],
33
            ['loadByUrl', ['http://google.com']],
34
            ['updateUrl', [1, new URLUpdateStruct()], ['url-1']],
35
        ];
36
    }
37
38
    public function providerForCachedLoadMethods(): array
39
    {
40
        $url = new URL(['id' => 1]);
41
42
        // string $method, array $arguments, string $key, mixed? $data
43
        return [
44
            ['loadById', [1], 'ez-url-1', [$url]],
45
        ];
46
    }
47
}
48