Completed
Push — master ( d7bbda...0e324f )
by Kamil
06:08
created

ContainerBasedContainerAccessorSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 3
dl 0
loc 28
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_is_a_container_accessor() 0 4 1
A it_gets_a_service() 0 8 1
A it_gets_parameters() 0 6 1
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\Container;
17
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
18
19
final class ContainerBasedContainerAccessorSpec extends ObjectBehavior
20
{
21
    function let(Container $container)
22
    {
23
        $this->beConstructedWith($container);
24
    }
25
26
    function it_is_a_container_accessor()
27
    {
28
        $this->shouldImplement(ContainerAccessor::class);
29
    }
30
31
    function it_gets_a_service(Container $container)
32
    {
33
        $service = new \stdClass();
34
35
        $container->get('acme')->willReturn($service);
36
37
        $this->getService('acme')->shouldReturn($service);
38
    }
39
40
    function it_gets_parameters(Container $container)
41
    {
42
        $container->getParameterBag()->willReturn(new ParameterBag(['name' => 'value']));
43
44
        $this->getParameters()->shouldReturn(['name' => 'value']);
45
    }
46
}
47