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

TestingKernel::getCacheDir()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
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
}