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

InnmindNeo4jBundleTest::testBuild()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 30
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 30
ccs 0
cts 29
cp 0
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 21
nc 1
nop 0
crap 2
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