Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function testWriteCompletedEventInDb(): void |
||
15 | { |
||
16 | $event = ['message' => 'original']; |
||
17 | $completedEvent = ['message' => 'completed']; |
||
18 | |||
19 | $logRepository = self::createMock(LogRepository::class); |
||
|
|||
20 | $logRepository->expects(self::once()) |
||
21 | ->method('log') |
||
22 | ->with($completedEvent); |
||
23 | |||
24 | $eventCompleter = self::createMock(EventCompleter::class); |
||
25 | $eventCompleter->expects(self::once()) |
||
26 | ->method('process') |
||
27 | ->with($event) |
||
28 | ->willReturn($completedEvent); |
||
29 | |||
30 | $writer = new Db($logRepository, $eventCompleter); |
||
31 | $writer->write($event); |
||
32 | } |
||
34 |