Completed
Push — feature-EZP-25696 ( 1cfd30...140426 )
by André
24:27
created

AbstractContentSlotTest::testReceivePurgesCacheForContent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
rs 9.4285
1
<?php
2
3
/**
4
 * This file is part of the eZ Publish Kernel package.
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\MVC\Symfony\Cache\Tests\Http\SignalSlot;
10
11
abstract class AbstractContentSlotTest extends AbstractSlotTest
12
{
13
    protected $contentId = 42;
14
    protected $locationId = null;
15
    protected $parentLocationId = null;
16
17
    /**
18
     * @return array
19
     */
20
    public function generateTags()
21
    {
22
        $tags = [];
23
        if ($this->contentId){
24
            $tags = ['content-'.$this->contentId, 'relation-'.$this->contentId];
25
        }
26
27
        if ($this->locationId) {
28
            // self(s)
29
            $tags[] = 'location-'.$this->locationId;
30
            // children
31
            $tags[] = 'parent-'.$this->locationId;
32
        }
33
34
        if ($this->parentLocationId) {
35
            // parent(s)
36
            $tags[] = 'location-'.$this->parentLocationId;
37
            // siblings
38
            $tags[] = 'parent-'.$this->parentLocationId;
39
        }
40
41
        return $tags;
42
    }
43
}
44