| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | public function serverIsFetchedFromCallbackAndDecorated(): void |
||
| 25 | { |
||
| 26 | $server = $this->createMock(HttpServer::class); |
||
| 27 | $server |
||
| 28 | ->expects($this->exactly(2)) |
||
| 29 | ->method('on'); |
||
| 30 | $callback = function () use ($server) { |
||
| 31 | return $server; |
||
| 32 | }; |
||
| 33 | |||
| 34 | $container = $this->prophesize(ContainerInterface::class); |
||
| 35 | $getTaskRunner = $container->get(TaskRunner::class)->willReturn($this->prophesize(TaskRunner::class)->reveal()); |
||
| 36 | $getLogger = $container->get(LoggerInterface::class)->willReturn( |
||
| 37 | $this->prophesize(LoggerInterface::class)->reveal() |
||
| 38 | ); |
||
| 39 | |||
| 40 | $result = ($this->delegator)($container->reveal(), '', $callback); |
||
| 41 | |||
| 42 | $this->assertSame($server, $result); |
||
| 43 | $getTaskRunner->shouldHaveBeenCalledOnce(); |
||
| 44 | $getLogger->shouldHaveBeenCalledOnce(); |
||
| 45 | } |
||
| 47 |