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 Symfony\Component\DependencyInjection\ContainerBuilder; |
18
|
|
|
use Symfony\Component\DependencyInjection\Exception\RuntimeException; |
19
|
|
|
use Symfony\Component\HttpKernel\Bundle\Bundle; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Spec file of TwigBridgeBundle class. |
23
|
|
|
* |
24
|
|
|
* @author Beñat Espiña <[email protected]> |
25
|
|
|
*/ |
26
|
|
|
class TwigBridgeBundleSpec extends ObjectBehavior |
27
|
|
|
{ |
28
|
|
|
function it_is_initializable() |
29
|
|
|
{ |
30
|
|
|
$this->shouldHaveType(TwigBridgeBundle::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
|
|
|
'TwigBundle' => 'Symfony\\Bundle\\TwigBundle\\TwigBundle', |
48
|
|
|
]); |
49
|
|
|
|
50
|
|
|
$container->loadFromExtension('framework', [ |
51
|
|
|
'translator' => [ |
52
|
|
|
'paths' => [ |
53
|
|
|
'%kernel.root_dir%/../vendor/bengor-user/twig-bridge/src/BenGorUser/TwigBridge/Infrastructure/Ui/Translations', |
54
|
|
|
], |
55
|
|
|
], |
56
|
|
|
])->shouldBeCalled()->willReturn($container); |
57
|
|
|
|
58
|
|
|
$container->loadFromExtension('twig', [ |
59
|
|
|
'paths' => [ |
60
|
|
|
'%kernel.root_dir%/../vendor/bengor-user/twig-bridge/src/BenGorUser/TwigBridge/Infrastructure/Ui/Twig/views' => 'bengor_user', |
61
|
|
|
], |
62
|
|
|
])->shouldBeCalled()->willReturn($container); |
63
|
|
|
|
64
|
|
|
$this->build($container); |
65
|
|
|
} |
66
|
|
|
} |
67
|
|
|
|