/** * @expectedException \RuntimeException */ public function testSendAndWaitException() { $command = new HelloCommand('Hi !!!'); \Phake::when($this->mockCommandBus)->dispatch(\Phake::anyParameters())->thenThrow(new \RuntimeException("exception")); $this->testSubject->sendAndWait($command); }