/**
* @test
*/
public function it_can_also_wrap_a_normal_exception()
{
$pendingCommands = ['dispatchMe', 'tellMe'];
$prevException = new \Exception('previous');
$commandDispatchException = CommandDispatchException::wrap($prevException, $pendingCommands);
$this->assertSame('Command dispatch failed. See previous exception for details.', $commandDispatchException->getMessage());
$this->assertSame(422, $commandDispatchException->getCode());
$this->assertSame($prevException, $commandDispatchException->getPrevious());
$this->assertSame($pendingCommands, $commandDispatchException->getPendingCommands());
}