Completed
Push — master ( 534d55...058505 )
by Kamil
04:06 queued 26s
created

  A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 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 View Code Duplication
    function it_gets_parameters_from_frozen_container(Container $container)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
41
    {
42
        $container->isFrozen()->willReturn(true);
43
        $container->getParameterBag()->willReturn(new ParameterBag(['name' => 'value']));
44
45
        $this->getParameters()->shouldReturn(['name' => 'value']);
46
    }
47
48 View Code Duplication
    function it_gets_parameters_from_not_frozen_container(Container $container)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
49
    {
50
        $container->isFrozen()->willReturn(false);
51
        $container->getParameterBag()->willReturn(new ParameterBag(['name' => 'value']));
52
53
        $this->getParameters()->shouldReturn(['name' => 'value']);
54
    }
55
}
56