@@ 81-91 (lines=11) @@ | ||
78 | /** |
|
79 | * Test dispatch with invalid command. |
|
80 | */ |
|
81 | public function testDispatchWithInvalidCommand() |
|
82 | { |
|
83 | $this |
|
84 | ->given($commandBus = CommandBus::create()) |
|
85 | ->then() |
|
86 | ->exception(function () use ($commandBus) { |
|
87 | $commandBus->dispatch(new FooMessage()); |
|
88 | }) |
|
89 | ->isInstanceOf(\InvalidArgumentException::class) |
|
90 | ; |
|
91 | } |
|
92 | ||
93 | /** |
|
94 | * Test handlerMiddleware method. |
@@ 80-90 (lines=11) @@ | ||
77 | /** |
|
78 | * Test dispatch with invalid query. |
|
79 | */ |
|
80 | public function testDispatchWithInvalidQuery() |
|
81 | { |
|
82 | $this |
|
83 | ->given($queryBus = QueryBus::create()) |
|
84 | ->then() |
|
85 | ->exception(function () use ($queryBus) { |
|
86 | $queryBus->dispatch(new FooMessage()); |
|
87 | }) |
|
88 | ->isInstanceOf(\InvalidArgumentException::class) |
|
89 | ; |
|
90 | } |
|
91 | } |
|
92 |