Completed
Push — siteaccessaware-layer-only ( 14ffb6 )
by André
15:43
created

AbstractBaseServiceTest::getHandlerMock()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 0
loc 16
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace eZ\Publish\Core\Repository\SiteAccessAware\Tests;
4
5
use eZ\Publish\Core\Repository\Helper\LanguageResolver;
6
use eZ\Publish\Core\Repository\SiteAccessAware\Repository;
7
use eZ\Publish\SPI\Persistence\Handler;
8
use PHPUnit\Framework\TestCase;
9
10
abstract class AbstractBaseServiceTest extends TestCase
11
{
12
    /**
13
     * @var \eZ\Publish\API\Repository\Repository|\PHPUnit_Framework_MockObject_MockObject
14
     */
15
    protected $innerRepositoryMock;
16
    /**
17
     * @var \eZ\Publish\Core\Repository\SiteAccessAware\Repository
18
     */
19
    protected $siteAccessAwareRepositoryHandler;
20
    /**
21
     * @var \eZ\Publish\Core\Repository\Helper\LanguageResolver|\PHPUnit_Framework_MockObject_MockObject
22
     */
23
    protected $languageHelperMock;
24
25
    public function setUp()
26
    {
27
        parent::setUp();
28
        $this->languageHelperMock = $this->getMockBuilder(LanguageResolver::class)->getMock();
29
    }
30
31
    protected function tearDown()
32
    {
33
        unset($this->languageHelperMock);
34
        parent::tearDown();
35
    }
36
37
    protected function getHandlerMock()
38
    {
39
        $handlerMock = $this->getMockBuilder(Handler::class);
40
41
        $handlerMock
0 ignored issues
show
Bug introduced by
The method expects() does not seem to exist on object<PHPUnit_Framework_MockObject_MockBuilder>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
42
            ->expects($this->any())
43
            ->method('contentHandler')
44
            ->willReturn($this->getContentHandlerMock());
0 ignored issues
show
Bug introduced by
The method getContentHandlerMock() does not seem to exist on object<eZ\Publish\Core\R...bstractBaseServiceTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
45
46
        $handlerMock
0 ignored issues
show
Bug introduced by
The method expects() does not seem to exist on object<PHPUnit_Framework_MockObject_MockBuilder>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
47
            ->expects($this->any())
48
            ->method('contentLanguageHandler')
49
            ->willReturn($this->getContentLanguageHandlerMock());
0 ignored issues
show
Bug introduced by
The method getContentLanguageHandlerMock() does not seem to exist on object<eZ\Publish\Core\R...bstractBaseServiceTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
50
51
        return $handlerMock;
52
    }
53
54
}
55