|
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
|
|
|
|