|
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
|
|
|
|