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\SimpleBusBridgeBundle; |
14
|
|
|
|
15
|
|
|
use BenGorUser\SimpleBusBridgeBundle\DependencyInjection\Compiler\SimpleBusPass; |
16
|
|
|
use BenGorUser\SimpleBusBridgeBundle\SimpleBusBridgeBundle; |
17
|
|
|
use BenGorUser\UserBundle\LoadableBundle; |
18
|
|
|
use PhpSpec\ObjectBehavior; |
19
|
|
|
use Symfony\Component\DependencyInjection\Compiler\PassConfig; |
20
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
21
|
|
|
use Symfony\Component\DependencyInjection\Exception\RuntimeException; |
22
|
|
|
use Symfony\Component\HttpKernel\Bundle\Bundle; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* Spec file of SimpleBusBridgeBundle class. |
26
|
|
|
* |
27
|
|
|
* @author Beñat Espiña <[email protected]> |
28
|
|
|
*/ |
29
|
|
|
class SimpleBusBridgeBundleSpec extends ObjectBehavior |
30
|
|
|
{ |
31
|
|
|
function it_is_initializable() |
32
|
|
|
{ |
33
|
|
|
$this->shouldHaveType(SimpleBusBridgeBundle::class); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
function it_extends_symfony_bundle() |
37
|
|
|
{ |
38
|
|
|
$this->shouldHaveType(Bundle::class); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
function it_implements_loadable_bundle() |
42
|
|
|
{ |
43
|
|
|
$this->shouldImplement(LoadableBundle::class); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
function it_builds_without_dependent_bundles_enabled(ContainerBuilder $container) |
47
|
|
|
{ |
48
|
|
|
$this->shouldThrow(RuntimeException::class)->duringBuild($container); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
function it_builds(ContainerBuilder $container) |
52
|
|
|
{ |
53
|
|
|
$container->getParameter('kernel.bundles')->shouldBeCalled()->willReturn([ |
54
|
|
|
'BenGorUserBundle' => 'BenGorUser\\UserBundle\\BenGorUserBundle', |
55
|
|
|
'DoctrineBundle' => 'Doctrine\\Bundle\\DoctrineBundle\\DoctrineBundle', |
56
|
|
|
]); |
57
|
|
|
|
58
|
|
|
$this->build($container); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
function it_loads(ContainerBuilder $container) |
62
|
|
|
{ |
63
|
|
|
$container->addCompilerPass( |
64
|
|
|
new SimpleBusPass(), PassConfig::TYPE_OPTIMIZE |
65
|
|
|
)->shouldBeCalled()->willReturn($container); |
66
|
|
|
|
67
|
|
|
$this->load($container); |
68
|
|
|
} |
69
|
|
|
} |
70
|
|
|
|