/** * @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'); }); }
/** * @test */ public function it_should_continue_if_its_not_a_message() { $this->capturer->shouldReceive('publish'); $command = new \stdClass(); $this->execute($this->middleware, $command, $command); }