| @@ 72-82 (lines=11) @@ | ||
| 69 | /** |
|
| 70 | * Test dispatch with invalid event. |
|
| 71 | */ |
|
| 72 | public function testDispatchWithInvalidEvent() |
|
| 73 | { |
|
| 74 | $this |
|
| 75 | ->given($eventBus = EventBus::create()) |
|
| 76 | ->then() |
|
| 77 | ->exception(function () use ($eventBus) { |
|
| 78 | $eventBus->dispatch(new FooMessage()); |
|
| 79 | }) |
|
| 80 | ->isInstanceOf(\InvalidArgumentException::class) |
|
| 81 | ; |
|
| 82 | } |
|
| 83 | ||
| 84 | /** |
|
| 85 | * Test dispatcherMiddleware method. |
|
| @@ 78-88 (lines=11) @@ | ||
| 75 | /** |
|
| 76 | * Test dispatch with invalid query. |
|
| 77 | */ |
|
| 78 | public function testDispatchWithInvalidQuery() |
|
| 79 | { |
|
| 80 | $this |
|
| 81 | ->given($queryBus = QueryBus::create()) |
|
| 82 | ->then() |
|
| 83 | ->exception(function () use ($queryBus) { |
|
| 84 | $queryBus->dispatch(new FooMessage()); |
|
| 85 | }) |
|
| 86 | ->isInstanceOf(\InvalidArgumentException::class) |
|
| 87 | ; |
|
| 88 | } |
|
| 89 | } |
|
| 90 | ||
| @@ 93-103 (lines=11) @@ | ||
| 90 | /** |
|
| 91 | * Test dispatch with invalid command. |
|
| 92 | */ |
|
| 93 | public function testDispatchWithInvalidCommand() |
|
| 94 | { |
|
| 95 | $this |
|
| 96 | ->given($commandBus = CommandBus::create()) |
|
| 97 | ->then() |
|
| 98 | ->exception(function () use ($commandBus) { |
|
| 99 | $commandBus->dispatch(new FooMessage()); |
|
| 100 | }) |
|
| 101 | ->isInstanceOf(\InvalidArgumentException::class) |
|
| 102 | ; |
|
| 103 | } |
|
| 104 | ||
| 105 | /** |
|
| 106 | * Test handlerMiddleware method. |
|