Skip to content

Modifies unit tests to accommodate event ID check #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Example/Auth/Tests/FIRPhoneAuthProviderTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,14 @@ - (void)testVerifyPhoneNumberUIDelegate {
// `callbackMatcher` is at index 4
[invocation getArgument:&unretainedArgument atIndex:4];
FIRAuthURLCallbackMatcher callbackMatcher = unretainedArgument;
NSURLComponents *originalComponents =
[[NSURLComponents alloc] initWithString:kFakeRedirectURLStringWithReCAPTCHAToken];
NSMutableString *redirectURL =
[NSMutableString stringWithString:kFakeRedirectURLStringWithReCAPTCHAToken];
// Verify that the URL is rejected by the callback matcher without the event ID.
XCTAssertFalse(callbackMatcher([NSURL URLWithString:redirectURL]));
[redirectURL appendString:@"%26eventId%3D"];
[redirectURL appendString:params[@"eventId"]];
NSURLComponents *originalComponents = [[NSURLComponents alloc] initWithString:redirectURL];
// Verify that the URL is accepted by the callback matcher with the matching event ID.
XCTAssertTrue(callbackMatcher([originalComponents URL]));
NSURLComponents *components = [originalComponents copy];
components.query = @"https";
Expand Down