Completed
Push — master ( da5294...d5aa74 )
by Kamil
09:29
created

it_gets_a_parameter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
1
<?php
2
3
/*
4
 * This file is part of the CrossContainerExtension package.
5
 *
6
 * (c) Kamil Kokot <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace spec\FriendsOfBehat\CrossContainerExtension;
13
14
use FriendsOfBehat\CrossContainerExtension\ContainerAccessor;
15
use PhpSpec\ObjectBehavior;
16
use Symfony\Component\DependencyInjection\ContainerInterface;
17
use Symfony\Component\HttpKernel\KernelInterface;
18
19
final class KernelBasedContainerAccessorSpec extends ObjectBehavior
20
{
21
    function let(KernelInterface $kernel)
22
    {
23
        $this->beConstructedWith($kernel);
24
    }
25
26
    function it_is_a_container_accessor()
27
    {
28
        $this->shouldImplement(ContainerAccessor::class);
29
    }
30
31
    function it_gets_a_service(KernelInterface $kernel, ContainerInterface $container)
32
    {
33
        $service = new \stdClass();
34
35
        $kernel->getContainer()->willReturn($container);
36
        $container->get('acme')->willReturn($service);
37
38
        $this->getService('acme')->shouldReturn($service);
39
    }
40
41
    function it_gets_a_parameter(KernelInterface $kernel, ContainerInterface $container)
42
    {
43
        $kernel->getContainer()->willReturn($container);
44
        $container->getParameter('acme')->willReturn('parameter value');
45
46
        $this->getParameter('acme')->shouldReturn('parameter value');
47
    }
48
}
49