Completed
Push — ezp28048_trash_move_when_cant_... ( f2b086...c48dd6 )
by
unknown
26:27 queued 11:24
created

CopySubtreeSlotTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 37
rs 10
wmc 4
lcom 1
cbo 2

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testReceivePurgesCacheForLocations() 0 10 1
A createSignal() 0 8 1
A getSlotClass() 0 4 1
A getReceivedSignalClasses() 0 4 1
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
use eZ\Publish\Core\MVC\Symfony\Cache\Http\SignalSlot\CopySubtreeSlot;
12
use eZ\Publish\Core\SignalSlot\Signal\LocationService\CopySubtreeSignal;
13
14
class CopySubtreeSlotTest extends AbstractSlotTest
15
{
16
    protected static $locationIds = [43];
17
18
    /**
19
     * @dataProvider getReceivedSignals
20
     */
21
    public function testReceivePurgesCacheForLocations($signal)
22
    {
23
        $this->cachePurgerMock->expects($this->once())
24
            ->method('purge')
25
            ->with(self::$locationIds);
26
27
        $this->cachePurgerMock->expects($this->never())->method('purgeAll');
28
29
        parent::receive($signal);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (receive() instead of testReceivePurgesCacheForLocations()). Are you sure this is correct? If so, you might want to change this to $this->receive().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
30
    }
31
32
    public static function createSignal()
33
    {
34
        return new CopySubtreeSignal([
35
            'subtreeId' => 67,
36
            'targetParentLocationId' => 43,
37
            'targetNewSubtreeId' => 45,
38
        ]);
39
    }
40
41
    public function getSlotClass()
42
    {
43
        return CopySubtreeSlot::class;
44
    }
45
46
    public static function getReceivedSignalClasses()
47
    {
48
        return [CopySubtreeSignal::class];
49
    }
50
}
51