Passed
Branch master (b46ccf)
by Juan
17:57 queued 08:11
created

AppTestKernel   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 25
c 1
b 0
f 0
dl 0
loc 43
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configureContainer() 0 30 1
A registerBundles() 0 6 1
1
<?php
2
3
namespace Micayael\NativeQueryFromFileBuilderBundle\Tests;
4
5
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
6
use Micayael\NativeQueryFromFileBuilderBundle\NativeQueryFromFileBuilderBundle;
7
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
8
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
9
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
10
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
11
12
class AppTestKernel extends BaseKernel
13
{
14
    use MicroKernelTrait;
0 ignored issues
show
Bug introduced by
The trait Symfony\Bundle\Framework...Kernel\MicroKernelTrait requires the property $instanceof which is not provided by Micayael\NativeQueryFrom...dle\Tests\AppTestKernel.
Loading history...
15
16
    public function registerBundles(): iterable
17
    {
18
        return [
19
            new NativeQueryFromFileBuilderBundle(),
20
            new FrameworkBundle(),
21
            new DoctrineBundle(),
22
        ];
23
    }
24
25
    protected function configureContainer(ContainerConfigurator $c): void
26
    {
27
        $c->extension('framework', [
28
            'secret' => 'devsecret',
29
            'router' => [
30
                'utf8' => true,
31
            ],
32
        ]);
33
34
        $c->extension('doctrine', [
35
            'dbal' => [
36
                'default_connection' => 'default',
37
                'connections' => [
38
                    'default' => [
39
                        'dbname' => null,
40
                        'host' => 'localhost',
41
                        'port' => null,
42
                        'user' => 'root',
43
                        'password' => null,
44
                    ],
45
                ],
46
            ],
47
            'orm' => [
48
                'default_entity_manager' => null,
49
            ],
50
        ]);
51
52
        $c->extension('native_query_from_file_builder', [
53
            'sql_queries_dir' => 'config/queries',
54
            'cache_sql' => false,
55
        ]);
56
    }
57
}
58