1515//
1616
1717@import XCTest;
18- @import FirebaseAuth ;
18+ @import FirebaseCore ;
1919@import FirebaseAuthUI;
20- #import < OCMock/OCMock.h>
2120#import " FUIAuthUtils.h"
2221
2322@interface FUILoginProvider : NSObject <FUIAuthProvider>
@@ -44,24 +43,35 @@ - (UIColor *)buttonTextColor {
4443 return [UIColor whiteColor ];
4544}
4645
46+ #pragma clang diagnostic push
47+ #pragma clang diagnostic ignored "-Wdeprecated-implementations"
4748- (void )signInWithEmail : (NSString *)email
4849 presentingViewController : (UIViewController *)presentingViewController
4950 completion : (FIRAuthProviderSignInCompletionBlock)completion {}
51+ #pragma clang diagnostic pop
5052
5153- (void )signOut {}
5254
5355- (BOOL )handleOpenURL : (NSURL *)URL sourceApplication : (NSString *)sourceApplication {
5456 return self.canHandleURLs ;
5557}
5658
59+ - (void )signInWithDefaultValue : (nullable NSString *)defaultValue
60+ presentingViewController : (nullable UIViewController *)presentingViewController
61+ completion : (nullable FIRAuthProviderSignInCompletionBlock)completion {}
62+
63+
5764@end
5865
5966@interface FUIAuthUIDelegate : NSObject <FUIAuthDelegate>
6067@end
6168
6269@implementation FUIAuthUIDelegate
70+ #pragma clang diagnostic push
71+ #pragma clang diagnostic ignored "-Wdeprecated-implementations"
6372- (void )authUI : (FUIAuth *)authUI didSignInWithUser : (FIRUser *)user error : (NSError *)error {
6473}
74+ #pragma clang diagnostic pop
6575
6676- (FUIAuthPickerViewController *)authPickerViewControllerForAuthUI : (FUIAuth *)authUI {
6777 Class controllerClass = [FUIAuthPickerViewController class ];
@@ -83,16 +93,13 @@ @implementation FUIAuthTest
8393
8494- (void )setUp {
8595 [super setUp ];
86- id authClass = OCMClassMock ([FIRAuth class ]);
87- OCMStub (ClassMethod ([authClass auth ])).
88- andReturn (authClass);
8996
90- id mockUtilsClass = OCMClassMock ([FUIAuthUtils class ]);
91- OCMStub ( ClassMethod ([mockUtilsClass bundleNamed: OCMOCK_ANY])).
92- andReturn ([ NSBundle bundleForClass: [FUIAuth class ]]);
97+ if ([FIRApp defaultApp ] == nil ) {
98+ [FIRApp configure ];
99+ }
93100
94- self.auth = [FIRAuth auth ];
95- self.authUI = [FUIAuth defaultAuthUI ];
101+ self.auth = [FIRAuth authWithApp: [FIRApp defaultApp ] ];
102+ self.authUI = [FUIAuth authUIWithAuth: self .auth ];
96103 self.delegate = [[FUIAuthUIDelegate alloc ] init ];
97104}
98105
0 commit comments