GIDFakeAuthorizationFlowProcessor.m 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright 2023 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import "GoogleSignIn/Sources/GIDAuthorizationFlowProcessor/Implementations/Fakes/GIDFakeAuthorizationFlowProcessor.h"
  17. #ifdef SWIFT_PACKAGE
  18. @import AppAuth;
  19. #else
  20. #import <AppAuth/AppAuth.h>
  21. #endif
  22. @implementation GIDFakeAuthorizationFlowProcessor
  23. - (void)startWithOptions:(GIDSignInInternalOptions *)options
  24. emmSupport:(nullable NSString *)emmSupport
  25. completion:(void (^)(OIDAuthorizationResponse *_Nullable authorizationResponse,
  26. NSError *_Nullable error))completion {
  27. NSAssert(self.testBlock != nil, @"Set the test block before invoking this method.");
  28. self.testBlock(^(OIDAuthorizationResponse *authorizationResponse, NSError *error) {
  29. completion(authorizationResponse, error);
  30. });
  31. }
  32. - (BOOL)isStarted {
  33. NSAssert(NO, @"Not implemented.");
  34. return YES;
  35. }
  36. - (BOOL)resumeExternalUserAgentFlowWithURL:(NSURL *)url {
  37. NSAssert(NO, @"Not implemented.");
  38. return YES;
  39. }
  40. - (void)cancelAuthenticationFlow {
  41. NSAssert(NO, @"Not implemented.");
  42. }
  43. @end