BaseTestCase::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace Cmobi\RabbitmqBundle\Tests;
4
5
use Monolog\Logger;
6
use Psr\Log\LoggerInterface;
7
use Symfony\Component\DependencyInjection\Container;
8
9
class BaseTestCase extends \PHPUnit_Framework_TestCase
10
{
11
    private $container;
12
13
    protected function setUp()
14
    {
15
        $kernel = new \AppKernel('test', true);
16
        $kernel->boot();
17
        $this->container = $kernel->getContainer();
18
    }
19
20
    /**
21
     * @return Container
22
     */
23
    protected function getContainer()
24
    {
25
        return $this->container;
26
    }
27
28
    /**
29
     * @return LoggerInterface
30
     */
31
    protected function getLoggerMock()
32
    {
33
        $logger = $this->getMockBuilder(Logger::class)
34
            ->disableOriginalConstructor()
35
            ->getMock();
36
37
        return $logger;
38
    }
39
}
40