Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public function testDispatch() |
||
17 | { |
||
18 | $event = new stdClass(); |
||
19 | $collector = new EventCollector(new TimelineCollector()); |
||
20 | $collector->startup(); |
||
21 | |||
22 | $eventDispatcherMock = $this->createMock(EventDispatcherInterface::class); |
||
23 | $eventDispatcherMock |
||
24 | ->expects($this->once()) |
||
25 | ->method('dispatch') |
||
26 | ->with($event) |
||
27 | ->willReturn($event); |
||
28 | $eventDispatcher = new EventDispatcherInterfaceProxy($eventDispatcherMock, $collector); |
||
29 | |||
30 | $newEvent = $eventDispatcher->dispatch($event); |
||
31 | |||
32 | $this->assertSame($event, $newEvent); |
||
33 | $this->assertCount(1, $collector->getCollected()); |
||
34 | } |
||
36 |