|
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\Location; |
|
12
|
|
|
use eZ\Publish\SPI\Persistence\Content\Location\Handler; |
|
13
|
|
|
use eZ\Publish\SPI\Persistence\Content\Location\CreateStruct; |
|
14
|
|
|
use eZ\Publish\SPI\Persistence\Content\Location\UpdateStruct; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Test case for Persistence\Cache\LocationHandler. |
|
18
|
|
|
*/ |
|
19
|
|
|
class LocationHandlerTest extends HandlerTest |
|
20
|
|
|
{ |
|
21
|
|
|
public function getHandlerMethodName() : string |
|
22
|
|
|
{ |
|
23
|
|
|
return 'locationHandler'; |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
public function getHandlerClassName() : string |
|
27
|
|
|
{ |
|
28
|
|
|
return Handler::class; |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
public function providerForUnCachedMethods() : array |
|
32
|
|
|
{ |
|
33
|
|
|
// string $method, array $arguments, array? $tags, string? $key |
|
34
|
|
|
return [ |
|
35
|
|
|
['create', ['Standard', 'standard']], |
|
36
|
|
|
]; |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
View Code Duplication |
public function providerForCachedLoadMethods() : array |
|
40
|
|
|
{ |
|
41
|
|
|
$object = new SPISection(['id' => 5]); |
|
42
|
|
|
|
|
43
|
|
|
// string $method, array $arguments, string $key, mixed? $data |
|
44
|
|
|
return [ |
|
45
|
|
|
['load', [12], 'ez-location-12', $object], |
|
46
|
|
|
['loadSubtreeIds', ['standard'], 'ez-section-standard-by-identifier', $object], |
|
47
|
|
|
]; |
|
48
|
|
|
} |
|
49
|
|
|
} |
|
50
|
|
|
|