| @@ 42-48 (lines=7) @@ | ||
| 39 | $this->getService('acme')->shouldReturn($service); |
|
| 40 | } |
|
| 41 | ||
| 42 | function it_gets_parameters_from_frozen_container(Container $container): void |
|
| 43 | { |
|
| 44 | $container->isCompiled()->willReturn(true); |
|
| 45 | $container->getParameterBag()->willReturn(new ParameterBag(['name' => 'value'])); |
|
| 46 | ||
| 47 | $this->getParameters()->shouldReturn(['name' => 'value']); |
|
| 48 | } |
|
| 49 | ||
| 50 | function it_gets_parameters_from_not_frozen_container(Container $container): void |
|
| 51 | { |
|
| @@ 50-56 (lines=7) @@ | ||
| 47 | $this->getParameters()->shouldReturn(['name' => 'value']); |
|
| 48 | } |
|
| 49 | ||
| 50 | function it_gets_parameters_from_not_frozen_container(Container $container): void |
|
| 51 | { |
|
| 52 | $container->isCompiled()->willReturn(false); |
|
| 53 | $container->getParameterBag()->willReturn(new ParameterBag(['name' => 'value'])); |
|
| 54 | ||
| 55 | $this->getParameters()->shouldReturn(['name' => 'value']); |
|
| 56 | } |
|
| 57 | } |
|
| 58 | ||
| @@ 70-78 (lines=9) @@ | ||
| 67 | $this->shouldThrow(\DomainException::class)->during('getService', ['acme']); |
|
| 68 | } |
|
| 69 | ||
| 70 | function it_gets_parameters_from_frozen_container(KernelInterface $kernel, Container $container): void |
|
| 71 | { |
|
| 72 | $kernel->getContainer()->willReturn($container); |
|
| 73 | ||
| 74 | $container->isCompiled()->willReturn(true); |
|
| 75 | $container->getParameterBag()->willReturn(new ParameterBag(['name' => 'value'])); |
|
| 76 | ||
| 77 | $this->getParameters()->shouldReturn(['name' => 'value']); |
|
| 78 | } |
|
| 79 | ||
| 80 | function it_gets_parameters_from_not_frozen_container(KernelInterface $kernel, Container $container): void |
|
| 81 | { |
|
| @@ 80-88 (lines=9) @@ | ||
| 77 | $this->getParameters()->shouldReturn(['name' => 'value']); |
|
| 78 | } |
|
| 79 | ||
| 80 | function it_gets_parameters_from_not_frozen_container(KernelInterface $kernel, Container $container): void |
|
| 81 | { |
|
| 82 | $kernel->getContainer()->willReturn($container); |
|
| 83 | ||
| 84 | $container->isCompiled()->willReturn(false); |
|
| 85 | $container->getParameterBag()->willReturn(new ParameterBag(['name' => 'value'])); |
|
| 86 | ||
| 87 | $this->getParameters()->shouldReturn(['name' => 'value']); |
|
| 88 | } |
|
| 89 | ||
| 90 | function it_throws_an_exception_if_could_not_get_parameters(KernelInterface $kernel, ContainerInterface $container): void |
|
| 91 | { |
|