ProophTest\ServiceBus\Exception\CommandDispatchExceptionTest::it_wraps_a_message_dispatch_exception_and_tracks_pending_commands PHP Method

it_wraps_a_message_dispatch_exception_and_tracks_pending_commands() public method

    public function it_wraps_a_message_dispatch_exception_and_tracks_pending_commands()
    {
        $pendingCommands = ['dispatchMe', 'tellMe'];
        $actionEvent = new DefaultActionEvent(MessageBus::EVENT_INVOKE_HANDLER);
        $prevException = new \Exception('previous');
        $messageDispatchException = MessageDispatchException::failed($actionEvent, $prevException);
        $commandDispatchException = CommandDispatchException::wrap($messageDispatchException, $pendingCommands);
        $this->assertSame($actionEvent, $commandDispatchException->getFailedDispatchEvent());
        $this->assertSame($prevException, $commandDispatchException->getPrevious());
        $this->assertSame($pendingCommands, $commandDispatchException->getPendingCommands());
    }