getExceptionMock()->shouldReceive('getResponse')->andReturn($this->exceptionResponse); } /** * Return a mocked instance of the request exception. * * @return \Mockery\MockInterface */ private function getExceptionMock(): MockInterface { return $this->exception ?? $this->exception = Mockery::mock(RequestException::class); } /** * Set the exception response. * * @param mixed $response */ protected function setExceptionResponse($response) { $this->exceptionResponse = $response; } }