SwiftMailerBridgeBundleSpec::it_builds()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the BenGorUser package.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 * (c) Gorka Laucirica <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace spec\BenGorUser\SwiftMailerBridgeBundle;
14
15
use BenGorUser\SwiftMailerBridgeBundle\SwiftMailerBridgeBundle;
16
use PhpSpec\ObjectBehavior;
17
use Symfony\Component\DependencyInjection\ContainerBuilder;
18
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
19
use Symfony\Component\HttpKernel\Bundle\Bundle;
20
21
/**
22
 * Spec file of SwiftMailerBridgeBundle class.
23
 *
24
 * @author Beñat Espiña <[email protected]>
25
 */
26
class SwiftMailerBridgeBundleSpec extends ObjectBehavior
27
{
28
    function it_is_initializable()
29
    {
30
        $this->shouldHaveType(SwiftMailerBridgeBundle::class);
31
    }
32
33
    function it_extends_symfony_bundle()
34
    {
35
        $this->shouldHaveType(Bundle::class);
36
    }
37
38
    function it_builds_without_dependent_bundles_enabled(ContainerBuilder $container)
39
    {
40
        $this->shouldThrow(RuntimeException::class)->duringBuild($container);
41
    }
42
43
    function it_builds(ContainerBuilder $container)
44
    {
45
        $container->getParameter('kernel.bundles')->shouldBeCalled()->willReturn([
46
            'BenGorUserBundle'  => 'BenGorUser\\UserBundle\\BenGorUserBundle',
47
            'SwiftmailerBundle' => 'Symfony\\Bundle\\SwiftmailerBundle\\SwiftmailerBundle',
48
        ]);
49
50
        $this->build($container);
51
    }
52
}
53