/** * @test */ public function it_discards_messages_that_where_captured_when_a_exception_occured() { $this->capturer->shouldReceive('clear')->withNoArgs()->once(); $this->capturer->shouldNotReceive('fetchMessages'); $this->setExpectedException(\RuntimeException::class, 'Failed'); $this->middleware->execute('some_command', function () { throw new \RuntimeException('Failed'); }); }