Completed
Push — EZP-31287 ( fe8c5c...af9523 )
by
unknown
34:01
created

UrlWildcardHandlerTest::getHandlerClassName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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