Passed
Push — main ( ddea62...53290d )
by Leo
02:46
created

TestingKernel   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A registerContainerConfiguration() 0 4 1
A registerBundles() 0 4 1
A __construct() 0 4 1
A getCacheDir() 0 4 1
1
<?php
2
3
namespace MetroMarkets\FFBundle\Tests;
4
5
6
use MetroMarkets\FFBundle\MetroMarketsFFBundle;
7
use Symfony\Component\Config\Loader\LoaderInterface;
8
use Symfony\Component\DependencyInjection\ContainerBuilder;
9
use Symfony\Component\HttpKernel\Kernel;
10
11
class TestingKernel extends Kernel
12
{
13
    /** @var array */
14
    private $config;
15
16
    public function __construct(array $config = [])
17
    {
18
        $this->config = $config;
19
        parent::__construct('test', true);
20
    }
21
22
    public function registerBundles()
23
    {
24
        return [
25
            new MetroMarketsFFBundle(),
26
        ];
27
    }
28
29
    public function registerContainerConfiguration(LoaderInterface $loader)
30
    {
31
        $loader->load(function (ContainerBuilder $container) {
32
            $container->loadFromExtension('metro_markets_ff', $this->config);
33
        });
34
    }
35
36
    public function getCacheDir()
37
    {
38
        //makes sure that container is not re-used
39
        return __DIR__ . '/cache/' . spl_object_hash($this);
40
    }
41
}