FakeAppCheck.swift 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2023 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License")
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. import FirebaseAppCheckInterop
  15. @testable import FirebaseAuth
  16. import Foundation
  17. class FakeAppCheck: NSObject, AppCheckInterop {
  18. let fakeAppCheckToken = "fakeAppCheckToken"
  19. func getToken(forcingRefresh: Bool, completion: @escaping AppCheckTokenHandlerInterop) {
  20. completion(FakeAppCheckResult(token: "fakeAppCheckToken"))
  21. }
  22. func tokenDidChangeNotificationName() -> String {
  23. fatalError("implement me")
  24. }
  25. func notificationTokenKey() -> String {
  26. fatalError("implement me")
  27. }
  28. func notificationAppNameKey() -> String {
  29. fatalError("implement me")
  30. }
  31. }
  32. class FakeAppCheckResult: NSObject, FIRAppCheckTokenResultInterop {
  33. var token: String
  34. var error: Error?
  35. init(token: String) {
  36. self.token = token
  37. }
  38. }