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\TwigBridgeBundle; |
14
|
|
|
|
15
|
|
|
use BenGorUser\TwigBridgeBundle\TwigBridgeBundle; |
16
|
|
|
use PhpSpec\ObjectBehavior; |
17
|
|
|
use Prophecy\Argument; |
18
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
19
|
|
|
use Symfony\Component\DependencyInjection\Exception\RuntimeException; |
20
|
|
|
use Symfony\Component\HttpKernel\Bundle\Bundle; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Spec file of TwigBridgeBundle class. |
24
|
|
|
* |
25
|
|
|
* @author Beñat Espiña <[email protected]> |
26
|
|
|
*/ |
27
|
|
|
class TwigBridgeBundleSpec extends ObjectBehavior |
28
|
|
|
{ |
29
|
|
|
function it_is_initializable() |
30
|
|
|
{ |
31
|
|
|
$this->shouldHaveType(TwigBridgeBundle::class); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
function it_extends_symfony_bundle() |
35
|
|
|
{ |
36
|
|
|
$this->shouldHaveType(Bundle::class); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
function it_builds_without_dependent_bundles_enabled(ContainerBuilder $container) |
40
|
|
|
{ |
41
|
|
|
$this->shouldThrow(RuntimeException::class)->duringBuild($container); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
function it_builds(ContainerBuilder $container) |
45
|
|
|
{ |
46
|
|
|
$container->getParameter('kernel.bundles')->shouldBeCalled()->willReturn([ |
47
|
|
|
'BenGorUserBundle' => 'BenGorUser\\UserBundle\\BenGorUserBundle', |
48
|
|
|
'TwigBundle' => 'Symfony\\Bundle\\TwigBundle\\TwigBundle', |
49
|
|
|
]); |
50
|
|
|
|
51
|
|
|
$container->loadFromExtension('framework', Argument::type('array'))->shouldBeCalled()->willReturn($container); |
52
|
|
|
$container->loadFromExtension('twig', Argument::type('array'))->shouldBeCalled()->willReturn($container); |
53
|
|
|
|
54
|
|
|
$this->build($container); |
55
|
|
|
} |
56
|
|
|
} |
57
|
|
|
|