Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | public function postFlushShouldDispatchAllEvents(): void |
||
22 | { |
||
23 | $domainEvent = $this->createMock(DomainEvent::class); |
||
24 | $domainEvent->expects(self::once()) |
||
25 | ->method('getName') |
||
26 | ->willReturn(self::EVENT_NAME); |
||
27 | |||
28 | $releaser = $this->createMock(Releaser::class); |
||
29 | |||
30 | $releaser->expects(self::once()) |
||
31 | ->method('release') |
||
32 | ->willReturn([$domainEvent]); |
||
33 | |||
34 | $dispatcher = $this->createMock(EventDispatcherInterface::class); |
||
35 | |||
36 | $dispatcher->expects(self::once()) |
||
37 | ->method('dispatch') |
||
38 | ->with(self::isInstanceOf(SymfonyEvent::class), self::EVENT_NAME); |
||
39 | |||
40 | $eventDispatcher = new SimpleEventsDispatcher($releaser, $dispatcher); |
||
41 | |||
42 | $eventDispatcher->postFlush(); |
||
43 | } |
||
45 |