Completed
Push — master ( 627c37...9fcd11 )
by Olivier
03:49 queued 01:55
created

OlaRabbitMqAdminToolkitExtensionTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 80
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 2
Bugs 1 Features 1
Metric Value
wmc 2
c 2
b 1
f 1
lcom 1
cbo 2
dl 0
loc 80
rs 10
1
<?php
2
3
namespace Ola\RabbitMqAdminToolkitBundle\Tests\DependencyInjection;
4
5
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;
6
use Ola\RabbitMqAdminToolkitBundle\DependencyInjection\OlaRabbitMqAdminToolkitExtension;
7
8
class OlaRabbitMqAdminToolkitExtensionTest extends AbstractExtensionTestCase
9
{
10
    protected function getContainerExtensions()
11
    {
12
        return array(
13
            new OlaRabbitMqAdminToolkitExtension()
14
        );
15
    }
16
17
    public function test_load_()
18
    {
19
        $this->load(array(
20
            'delete_allowed' => true,
21
            'connections' => array(
22
                'default' => 'http://user:password@localhost:15672',
23
            ),
24
            'vhosts' => array(
25
                'test' => array(
26
                    'name' => '/test',
27
                    'connection' => 'default',
28
                    'permissions' => array(
29
                        'lafourchette' => NULL,
30
                    ),
31
                    'exchanges' => array(
32
                        'lf.exchange.a' => NULL,
33
                        'lf.exchange.b' => array(
34
                            'type' => 'direct',
35
                        ),
36
                        'lf.exchange.c' => NULL,
37
                    ),
38
                    'queues' => array(
39
                        'lf.queue.a' => array(
40
                            'bindings' => array(
41
                                array(
42
                                    'exchange' => 'lf.exchange.a',
43
                                    'routing_key' => 'a.#',
44
                                ),
45
                                array(
46
                                    'exchange' => 'lf.exchange.b',
47
                                    'routing_key' => 'b.#',
48
                                ),
49
                            ),
50
                        ),
51
                        'lf.queue.b' => array(
52
                            'bindings' => array(
53
                                array(
54
                                    'exchange' => 'lf.exchange.a',
55
                                    'routing_key' => 'a.#',
56
                                ),
57
                                array(
58
                                    'exchange' => 'lf.exchange.b',
59
                                    'routing_key' => 'b.#',
60
                                ),
61
                                array(
62
                                    'exchange' => 'lf.exchange.c',
63
                                    'routing_key' => 'c.#',
64
                                ),
65
                            ),
66
                        ),
67
                        'lf.queue.c' => array(
68
                            'bindings' => array(
69
                                array(
70
                                    'exchange' => 'lf.exchange.a',
71
                                    'routing_key' => 'a.#',
72
                                ),
73
                                array(
74
                                    'exchange' => 'lf.exchange.c',
75
                                    'routing_key' => 'c.#',
76
                                ),
77
                            ),
78
                        ),
79
                    ),
80
                ),
81
            ),
82
        ));
83
        $this->assertContainerBuilderHasService('ola_rabbit_mq_admin_toolkit.connection.default');
84
        $this->assertContainerBuilderHasService('ola_rabbit_mq_admin_toolkit.configuration.test');
85
        $this->assertContainerBuilderHasParameter('ola_rabbit_mq_admin_toolkit.default_vhost');
86
    }
87
}
88