aboutsummaryrefslogtreecommitdiffhomepage
path: root/Example
diff options
context:
space:
mode:
authorGravatar Zsika Phillip <protocol86@users.noreply.github.com>2018-01-09 09:43:13 -0800
committerGravatar GitHub <noreply@github.com>2018-01-09 09:43:13 -0800
commitc18af34fca72b5721cab4e3b26da7469df8fcc6b (patch)
tree2d76254fd07d4fd8a3a4794dfb79ee378b3063dc /Example
parente7347dc2f0c1a4b8bed6e85411021feb4634e405 (diff)
Amends phone auth unit tests (#632)
Diffstat (limited to 'Example')
-rw-r--r--Example/Auth/Tests/FIRAuthTests.m10
1 files changed, 7 insertions, 3 deletions
diff --git a/Example/Auth/Tests/FIRAuthTests.m b/Example/Auth/Tests/FIRAuthTests.m
index 6391b08..b22c600 100644
--- a/Example/Auth/Tests/FIRAuthTests.m
+++ b/Example/Auth/Tests/FIRAuthTests.m
@@ -430,6 +430,8 @@ static const NSTimeInterval kWaitInterval = .5;
dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
id mockVerifyPhoneResponse = OCMClassMock([FIRVerifyPhoneNumberResponse class]);
[self stubTokensWithMockResponse:mockVerifyPhoneResponse];
+ // Stub isNewUser flag in the response.
+ OCMStub([mockVerifyPhoneResponse isNewUser]).andReturn(YES);
callback(mockVerifyPhoneResponse, nil);
});
});
@@ -440,10 +442,12 @@ static const NSTimeInterval kWaitInterval = .5;
[[FIRPhoneAuthProvider provider] credentialWithVerificationID:kVerificationID
verificationCode:kVerificationCode];
- [[FIRAuth auth] signInWithCredential:credential completion:^(FIRUser *_Nullable user,
- NSError *_Nullable error) {
+ [[FIRAuth auth] signInAndRetrieveDataWithCredential:credential
+ completion:^(FIRAuthDataResult *_Nullable authDataResult,
+ NSError *_Nullable error) {
XCTAssertTrue([NSThread isMainThread]);
- [self assertUser:user];
+ [self assertUser:authDataResult.user];
+ XCTAssertTrue(authDataResult.additionalUserInfo.isNewUser);
XCTAssertNil(error);
[expectation fulfill];
}];