getExceptionMock($abstract)->shouldReceive('getResponse')->andReturn(value($response)); } /** * Return a mocked instance of the request exception. */ protected function getExceptionMock(string $abstract = RequestException::class): MockInterface { return $this->exception ?? $this->exception = Mockery::mock($abstract); } }