FIRApp+FIRAuthUnitTests.m 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright 2017 Google
  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 "FirebaseCore/Extension/FirebaseCoreInternal.h"
  17. #import "FirebaseAuth/Tests/Unit/FIRApp+FIRAuthUnitTests.h"
  18. @implementation FIRApp (FIRAuthUnitTests)
  19. /** @fn appOptions
  20. @brief Gets Firebase app options to be used for tests.
  21. @return A @c FIROptions instance.
  22. */
  23. + (FIROptions *)appOptions {
  24. return [[FIROptions alloc] initInternalWithOptionsDictionary:@{
  25. @"GOOGLE_APP_ID" : @"1:1085102361755:ios:f790a919483d5bdf",
  26. @"API_KEY" : @"FAKE_API_KEY",
  27. @"GCM_SENDER_ID" : @"217397612173",
  28. @"CLIENT_ID" : @"123456.apps.googleusercontent.com",
  29. }];
  30. }
  31. + (void)resetAppForAuthUnitTests {
  32. [FIRApp resetApps];
  33. [FIRApp configureWithOptions:[self appOptions]];
  34. }
  35. + (FIRApp *)appForAuthUnitTestsWithName:(NSString *)name {
  36. return [[FIRApp alloc] initInstanceWithName:name options:[self appOptions]];
  37. }
  38. @end