diff options
Diffstat (limited to 'Example/Auth/Tests/FIRAuthTests.m')
-rw-r--r-- | Example/Auth/Tests/FIRAuthTests.m | 10 |
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]; }]; |