BundleInitializationTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getBundleClass() 0 4 1
A testInitBundle() 0 19 1
1
<?php
2
3
namespace tests\Happyr\BlazeBundle\Functional;
4
5
use Happyr\BlazeBundle\HappyrBlazeBundle;
6
use Happyr\BlazeBundle\Service\BlazeManagerInterface;
7
use Nyholm\BundleTest\BaseBundleTestCase;
8
9
class BundleInitializationTest extends BaseBundleTestCase
10
{
11
    protected function getBundleClass()
12
    {
13
        return HappyrBlazeBundle::class;
14
    }
15
16
    public function testInitBundle()
17
    {
18
        // Create a new Kernel
19
        $kernel = $this->createKernel();
20
21
        // Add some configuration
22
        $kernel->addConfigFile(__DIR__.'/Resources/services.yml');
23
24
        // Boot the kernel.
25
        $this->bootKernel();
26
27
        // Get the containter
28
        $container = $this->getContainer();
29
30
        // Test if you services exists
31
        $this->assertTrue($container->has('test.happyr.blaze'));
32
        $service = $container->get('test.happyr.blaze');
33
        $this->assertInstanceOf(BlazeManagerInterface::class, $service);
34
    }
35
}
36