Completed
Push — reduce_cache_tags ( 8b6ee4 )
by André
19:52
created

providerForCachedLoadMethods()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 10
rs 9.9332
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\Core\Persistence\Cache\Tests\AbstractCacheHandlerTest;
10
use eZ\Publish\SPI\Persistence\Content\UrlWildcard\Handler as SpiUrlWildcardHandler;
11
use eZ\Publish\SPI\Persistence\Content\UrlWildcard;
12
13
class UrlWildcardHandlerTest extends AbstractCacheHandlerTest
14
{
15
    public function getHandlerMethodName(): string
16
    {
17
        return 'urlWildcardHandler';
18
    }
19
20
    public function getHandlerClassName(): string
21
    {
22
        return SpiUrlWildcardHandler::class;
23
    }
24
25
    public function providerForUnCachedMethods(): array
26
    {
27
        $wildcard = new UrlWildcard(['id' => 1]);
28
29
        // string $method, array $arguments, array? $tags, array|string? $key, mixed? $return
30
        return [
31
            ['create', ['/home/about', '/web3/some/page/link', true], ['urlWildcard-notFound'], null, $wildcard],
32
            ['remove', [1], ['urlWildcard-1']],
33
            ['loadAll', [], null, null, [$wildcard]],
34
            ['exactSourceUrlExists', ['/home/about'], null, null, true],
35
        ];
36
    }
37
38
    public function providerForCachedLoadMethods(): array
39
    {
40
        $wildcard = new UrlWildcard(['id' => 1]);
41
42
        // string $method, array $arguments, string $key, mixed? $data
43
        return [
44
            ['load', [1], 'ez-urlWildcard-1', $wildcard],
45
            ['translate', ['/home/about'], 'ez-urlWildcard-source-_Shome_Sabout', $wildcard],
46
        ];
47
    }
48
}
49