| Conditions | 1 |
| Paths | 1 |
| Total Lines | 29 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public function testItShouldPrepareContainerConfigFromMarshalledDelegatorFactories(): void |
||
| 17 | { |
||
| 18 | $config = new ContainerConfig([ |
||
| 19 | 'config' => [], |
||
| 20 | 'parameters' => [], |
||
| 21 | 'some.service' => \SplStack::class, |
||
| 22 | 'delegators' => [ |
||
| 23 | 'some.service' => [ |
||
| 24 | function (ContainerInterface $container, string $name, callable $callback): \SplStack { |
||
| 25 | /** @var \SplStack $stack */ |
||
| 26 | $stack = $callback(); |
||
| 27 | $stack->push('Hello World!!!'); |
||
| 28 | |||
| 29 | return $stack; |
||
| 30 | } |
||
| 31 | ] |
||
| 32 | ], |
||
| 33 | ]); |
||
| 34 | |||
| 35 | $marshallDelegatorConfig = new MarshalDelegatorsConfig(); |
||
| 36 | $marshalledConfig = $marshallDelegatorConfig($config); |
||
| 37 | $this->assertTrue($marshalledConfig->has('some.service')); |
||
| 38 | $this->assertIsCallable($marshalledConfig->get('some.service')); |
||
| 39 | $this->assertTrue($marshalledConfig->has('delegators')); |
||
| 40 | $delegators = $marshalledConfig->get('delegators'); |
||
| 41 | $this->assertArrayHasKey('some.service', $delegators); |
||
| 42 | $this->assertIsCallable($delegators['some.service'][0]); |
||
| 43 | $this->assertTrue($marshalledConfig->has(ContainerDelegatorFactory::class)); |
||
| 44 | $this->assertIsCallable($marshalledConfig->get(ContainerDelegatorFactory::class)); |
||
| 45 | } |
||
| 47 |