Completed
Push — master ( 87a78f...b306f9 )
by André
97:52 queued 72:52
created

AbstractPurgeForContentSlotTest::getContentId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
cc 1
eloc 2
nc 1
nop 0
rs 10
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 AbstractPurgeForContentSlotTest extends AbstractSlotTest implements PurgeForContentExpectation
12
{
13
    protected static $contentId = 42;
14
    protected static $locationIds = [];
15
16
    /**
17
     * @return mixed
18
     */
19
    public static function getContentId()
20
    {
21
        return static::$contentId;
22
    }
23
24
    /**
25
     * @return mixed[]
26
     */
27
    public static function getLocationIds()
28
    {
29
        return static::$locationIds;
30
    }
31
32
    /**
33
     * @dataProvider getReceivedSignals
34
     */
35
    public function testReceivePurgesCacheForContent($signal)
36
    {
37
        $this->cachePurgerMock->expects($this->once())->method('purgeForContent')->with(self::getContentId(), self::getLocationIds());
38
        $this->cachePurgerMock->expects($this->never())->method('purgeAll');
39
        parent::receive($signal);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (receive() instead of testReceivePurgesCacheForContent()). 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...
40
    }
41
}
42