Completed
Push — refonte ( 7173e3...bffa4c )
by Arnaud
02:33
created

LAGAdminExtensionTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 46
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace LAG\AdminBundle\Tests\DependencyInjection;
4
5
use LAG\AdminBundle\DependencyInjection\LAGAdminExtension;
6
use LAG\AdminBundle\Tests\AdminTestBase;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
9
class LAGAdminExtensionTest extends AdminTestBase
10
{
11
    /**
12
     * The load should allow the container to compile without errors.
13
     */
14
    public function testLoad()
15
    {
16
        $builder = $this->getMockWithoutConstructor(ContainerBuilder::class);
17
        $builder
18
            ->expects($this->atLeastOnce())
19
            ->method('setParameter')
20
            ->willReturnCallback(function ($parameter, $value) {
21
                $this->assertContains($parameter, [
22
                    'lag.admin.enable_extra_configuration',
23
                    'lag.admin.application_configuration',
24
                    'lag.admins',
25
                    'lag.menus',
26
                ]);
27
28
                if ('lag.admin.enable_extra_configuration' === $parameter) {
29
                    $this->assertContains($value, [
30
                        true,
31
                    ]);
32
                }
33
            })
34
        ;
35
36
        $extension = new LAGAdminExtension();
37
        $extension->load([
38
            'enable_extra_configuration' => true,
39
        ], $builder);
40
    }
41
42
    /**
43
     * The load should allow the container to compile without errors.
44
     */
45
    public function testLoadWithoutConfiguration()
46
    {
47
        $builder = $this->getMockWithoutConstructor(ContainerBuilder::class);
48
49
        $extension = new LAGAdminExtension();
50
        $extension->load([], $builder);
51
        // Every thing went fine
52
        $this->assertTrue(true);
53
    }
54
}
55