@@ -451,42 +451,6 @@ - (void)testFetchSignInMethodsForEmailSuccess {
451451 OCMVerifyAll (_mockBackend);
452452}
453453
454- /* * @fn testFetchProvidersForEmailSuccessDeprecatedProviderID
455- @brief Tests the flow of a successful @c fetchProvidersForEmail:completion: call using the
456- deprecated FIREmailPasswordAuthProviderID.
457- */
458- - (void )testFetchProvidersForEmailSuccessDeprecatedProviderID {
459- #pragma clang diagnostic push
460- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
461- NSArray <NSString *> *allProviders =
462- @[ FIRGoogleAuthProviderID, FIREmailAuthProviderID ];
463- #pragma clang diagnostic pop
464- OCMExpect ([_mockBackend createAuthURI: [OCMArg any ]
465- callback: [OCMArg any ]])
466- .andCallBlock2 (^(FIRCreateAuthURIRequest *_Nullable request,
467- FIRCreateAuthURIResponseCallback callback) {
468- XCTAssertEqualObjects (request.identifier , kEmail );
469- XCTAssertNotNil (request.endpoint );
470- XCTAssertEqualObjects (request.APIKey , kAPIKey );
471- dispatch_async (FIRAuthGlobalWorkQueue (), ^() {
472- id mockCreateAuthURIResponse = OCMClassMock ([FIRCreateAuthURIResponse class ]);
473- OCMStub ([mockCreateAuthURIResponse allProviders ]).andReturn (allProviders);
474- callback (mockCreateAuthURIResponse, nil );
475- });
476- });
477- XCTestExpectation *expectation = [self expectationWithDescription: @" callback" ];
478- [[FIRAuth auth ] fetchProvidersForEmail: kEmail
479- completion: ^(NSArray <NSString *> *_Nullable providers,
480- NSError *_Nullable error) {
481- XCTAssertTrue ([NSThread isMainThread ]);
482- XCTAssertEqualObjects (providers, allProviders);
483- XCTAssertNil (error);
484- [expectation fulfill ];
485- }];
486- [self waitForExpectationsWithTimeout: kExpectationTimeout handler: nil ];
487- OCMVerifyAll (_mockBackend);
488- }
489-
490454/* * @fn testFetchProvidersForEmailFailure
491455 @brief Tests the flow of a failed @c fetchProvidersForEmail:completion: call.
492456 */
@@ -1135,45 +1099,6 @@ - (void)testSignInWithEmailCredentialSuccess {
11351099 OCMVerifyAll (_mockBackend);
11361100}
11371101
1138- /* * @fn testSignInWithEmailCredentialSuccess
1139- @brief Tests the flow of a successfully @c signInWithCredential:completion: call with an
1140- email-password credential using the deprecated FIREmailPasswordAuthProvider.
1141- */
1142- - (void )testSignInWithEmailCredentialSuccessWithDepricatedProvider {
1143- OCMExpect ([_mockBackend verifyPassword: [OCMArg any ] callback: [OCMArg any ]])
1144- .andCallBlock2 (^(FIRVerifyPasswordRequest *_Nullable request,
1145- FIRVerifyPasswordResponseCallback callback) {
1146- XCTAssertEqualObjects (request.APIKey , kAPIKey );
1147- XCTAssertEqualObjects (request.email , kEmail );
1148- XCTAssertEqualObjects (request.password , kFakePassword );
1149- XCTAssertTrue (request.returnSecureToken );
1150- dispatch_async (FIRAuthGlobalWorkQueue (), ^() {
1151- id mockVeriyPasswordResponse = OCMClassMock ([FIRVerifyPasswordResponse class ]);
1152- [self stubTokensWithMockResponse: mockVeriyPasswordResponse];
1153- callback (mockVeriyPasswordResponse, nil );
1154- });
1155- });
1156- [self expectGetAccountInfo ];
1157- XCTestExpectation *expectation = [self expectationWithDescription: @" callback" ];
1158- [[FIRAuth auth ] signOut: NULL ];
1159- #pragma clang diagnostic push
1160- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
1161- FIRAuthCredential *emailCredential =
1162- [FIREmailAuthProvider credentialWithEmail: kEmail password: kFakePassword ];
1163- #pragma clang diagnostic pop
1164- [[FIRAuth auth ] signInWithCredential: emailCredential
1165- completion: ^(FIRAuthDataResult * _Nullable result,
1166- NSError *_Nullable error) {
1167- XCTAssertTrue ([NSThread isMainThread ]);
1168- [self assertUser: result.user];
1169- XCTAssertNil (error);
1170- [expectation fulfill ];
1171- }];
1172- [self waitForExpectationsWithTimeout: kExpectationTimeout handler: nil ];
1173- [self assertUser: [FIRAuth auth ].currentUser];
1174- OCMVerifyAll (_mockBackend);
1175- }
1176-
11771102/* * @fn testSignInWithEmailCredentialFailure
11781103 @brief Tests the flow of a failed @c signInWithCredential:completion: call with an
11791104 email-password credential.
0 commit comments