Passed
Push — master ( c35f28...3b0d87 )
by Michel
09:35 queued 02:21
created

BaseContainerTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 32
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __destruct() 0 3 1
A getContainer() 0 7 2
A setUp() 0 5 1
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