Completed
Push — master ( 081637...206e0a )
by Eric
06:26
created

LugUiBundleTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 39
rs 10
1
<?php
2
3
/*
4
 * This file is part of the Lug package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Lug\Bundle\UiBundle\Tests;
13
14
use Lug\Bundle\UiBundle\DependencyInjection\Compiler\RegisterMenuPass;
15
use Lug\Bundle\UiBundle\LugUiBundle;
16
use Symfony\Component\DependencyInjection\ContainerBuilder;
17
use Symfony\Component\HttpKernel\Bundle\Bundle;
18
19
/**
20
 * @author GeLo <[email protected]>
21
 */
22
class LugUiBundleTest extends \PHPUnit_Framework_TestCase
23
{
24
    /**
25
     * @var LugUiBundle
26
     */
27
    private $bundle;
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    protected function setUp()
33
    {
34
        $this->bundle = new LugUiBundle();
35
    }
36
37
    public function testInheritance()
38
    {
39
        $this->assertInstanceOf(Bundle::class, $this->bundle);
40
    }
41
42
    public function testBuild()
43
    {
44
        $container = $this->createContainerBuilderMock();
45
        $container
46
            ->expects($this->once())
47
            ->method('addCompilerPass')
48
            ->with($this->isInstanceOf(RegisterMenuPass::class));
49
50
        $this->bundle->build($container);
51
    }
52
53
    /**
54
     * @return \PHPUnit_Framework_MockObject_MockObject|ContainerBuilder
55
     */
56
    private function createContainerBuilderMock()
57
    {
58
        return $this->getMock(ContainerBuilder::class, ['addCompilerPass']);
59
    }
60
}
61