Passed
Branch master (3b0d87)
by Michel
14:26
created

BaseContainerTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace TogglJiraTest;
5
6
use Mockery;
7
use Mockery\MockInterface;
8
use PHPUnit\Framework\TestCase;
9
use Zend\ServiceManager\ServiceManager;
10
11
class BaseContainerTest extends TestCase
12
{
13
    /**
14
     * @var MockInterface
15
     */
16
    private $container;
17
18
    public function __destruct()
19
    {
20
        Mockery::close();
21
    }
22
23
    /**
24
     * @return void
25
     */
26
    protected function setUp(): void
27
    {
28
        Mockery::getConfiguration()->allowMockingNonExistentMethods(false);
29
30
        parent::setUp();
31
    }
32
33
    /**
34
     * @return MockInterface
35
     */
36
    protected function getContainer(): MockInterface
37
    {
38
        if ($this->container === null) {
39
            $this->container = \Mockery::mock(ServiceManager::class);
40
        }
41
42
        return $this->container;
43
    }
44
}
45