Completed
Push — develop ( 7f6ad2...eb155e )
by Baptiste
02:38
created

InnmindNeo4jBundleTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 33
ccs 0
cts 29
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B testBuild() 0 30 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Tests\Innmind\Neo4jBundle;
5
6
use Innmind\Neo4jBundle\{
7
    InnmindNeo4jBundle,
8
    DependencyInjection\InnmindNeo4jExtension
9
};
10
use Tests\Innmind\Neo4jBundle\{
11
    Fixture\FooBundle\FooBundle,
12
    Fixture\BarBundle\BarBundle,
13
    Fixture\EmptyBundle\EmptyBundle
14
};
15
use Innmind\Neo4j\ONM\ManagerInterface;
16
use Symfony\Component\{
17
    DependencyInjection\ContainerBuilder,
18
    DependencyInjection\Definition,
19
    HttpKernel\Bundle\Bundle,
20
    EventDispatcher\EventDispatcher
21
};
22
use Psr\Log\NullLogger;
23
24
class InnmindNeo4jBundleTest extends \PHPUnit_Framework_TestCase
25
{
26
    public function testBuild()
27
    {
28
        $c = new ContainerBuilder;
29
        ($b = new InnmindNeo4jBundle)->build($c);
30
        $this->assertInstanceOf(Bundle::class, $b);
31
        $c->registerExtension(new InnmindNeo4jExtension);
32
        $c->loadFromExtension('innmind_neo4j', []);
33
        $c->setDefinition(
34
            'event_dispatcher',
35
            new Definition(EventDispatcher::class)
36
        );
37
        $c->setDefinition(
38
            'logger',
39
            new Definition(NullLogger::class)
40
        );
41
        $c->setParameter(
42
            'kernel.bundles',
43
            [
44
                'FixtureFooBundle' => FooBundle::class,
45
                'FixtureBarBundle' => BarBundle::class,
46
                'FixtureEmptyBundle' => EmptyBundle::class,
47
            ]
48
        );
49
        $c->compile();
50
51
        $this->assertInstanceOf(
52
            ManagerInterface::class,
53
            $c->get('innmind_neo4j.manager')
54
        );
55
    }
56
}
57