Skip to content

Commit c1e39c8

Browse files
committed
Fix tests
1 parent 456fa26 commit c1e39c8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

FirebaseFacebookAuthUI/FirebaseFacebookAuthUITests/FirebaseFacebookAuthUITests.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ - (void)setUp {
4646
OCMStub(ClassMethod([self.mockOAuthProvider providerWithProviderID:OCMOCK_ANY])).
4747
andReturn(self.mockOAuthProvider);
4848

49+
id mockUtilsClass = OCMClassMock([FUIAuthUtils class]);
50+
OCMStub(ClassMethod([mockUtilsClass bundleNamed:OCMOCK_ANY
51+
inFrameworkBundle:OCMOCK_ANY])).
52+
andReturn([NSBundle bundleForClass:[FUIFacebookAuthTest class]]);
53+
4954
FIRAuth *auth = [FIRAuth auth];
5055
self.authUI = [FUIAuth authUIWithAuth:auth];
5156
self.provider = [[FUIFacebookAuthTest alloc] initWithAuthUI:self.authUI];

FirebaseFacebookAuthUI/Sources/FUIFacebookAuth.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ - (void)configureProvider {
318318
NSString *facebookDisplayName = [bundle objectForInfoDictionaryKey:kFacebookDisplayName];
319319

320320
if (facebookAppId == nil || facebookDisplayName == nil) {
321-
// Always use the app bundle to look up Facebook values.
322-
bundle = [NSBundle mainBundle];
321+
// Executes in test targets only.
322+
bundle = [FUIFacebookAuth bundle];
323323
facebookAppId = [bundle objectForInfoDictionaryKey:kFacebookAppId];
324324
facebookDisplayName = [bundle objectForInfoDictionaryKey:kFacebookDisplayName];
325325
}

0 commit comments

Comments
 (0)