aboutsummaryrefslogtreecommitdiffhomepage
path: root/Example/Auth/Tests/FIRPhoneAuthProviderTests.m
diff options
context:
space:
mode:
authorGravatar Paul Beusterien <paulbeusterien@google.com>2018-04-24 16:19:11 -0700
committerGravatar GitHub <noreply@github.com>2018-04-24 16:19:11 -0700
commit83b519f0a53a2efc946b32b1708d882a34f30d3a (patch)
tree57ec0e02b22e9b59d7d5976a83df6f4701620995 /Example/Auth/Tests/FIRPhoneAuthProviderTests.m
parent6a432ad6281c8f387e643757aba12d616f6757fd (diff)
Remove GTM dependency from FirebaseAuth (#1175)
Diffstat (limited to 'Example/Auth/Tests/FIRPhoneAuthProviderTests.m')
-rw-r--r--Example/Auth/Tests/FIRPhoneAuthProviderTests.m24
1 files changed, 16 insertions, 8 deletions
diff --git a/Example/Auth/Tests/FIRPhoneAuthProviderTests.m b/Example/Auth/Tests/FIRPhoneAuthProviderTests.m
index 2b58270..e00fa1f 100644
--- a/Example/Auth/Tests/FIRPhoneAuthProviderTests.m
+++ b/Example/Auth/Tests/FIRPhoneAuthProviderTests.m
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-#import <GoogleToolboxForMac/GTMNSDictionary+URLArguments.h>
#import <OCMock/OCMock.h>
#import <XCTest/XCTest.h>
@@ -34,6 +33,7 @@
#import "FIRAuthRequestConfiguration.h"
#import "FIRAuthUIDelegate.h"
#import "FIRAuthURLPresenter.h"
+#import "FIRAuthWebUtils.h"
#import "FIRGetProjectConfigRequest.h"
#import "FIRGetProjectConfigResponse.h"
#import "FIRSendVerificationCodeRequest.h"
@@ -409,12 +409,19 @@ static const NSTimeInterval kExpectationTimeout = 2;
XCTAssertEqualObjects(presentURL.scheme, @"https");
XCTAssertEqualObjects(presentURL.host, kFakeAuthorizedDomain);
XCTAssertEqualObjects(presentURL.path, @"/__/auth/handler");
- NSDictionary *params = [NSDictionary gtm_dictionaryWithHttpArgumentsString:presentURL.query];
- XCTAssertEqualObjects(params[@"ibi"], kFakeBundleID);
- XCTAssertEqualObjects(params[@"clientId"], kFakeClientID);
- XCTAssertEqualObjects(params[@"apiKey"], kFakeAPIKey);
- XCTAssertEqualObjects(params[@"authType"], @"verifyApp");
- XCTAssertNotNil(params[@"v"]);
+
+ NSURLComponents *actualURLComponents = [NSURLComponents componentsWithURL:presentURL
+ resolvingAgainstBaseURL:NO];
+ NSArray<NSURLQueryItem *> *queryItems = [actualURLComponents queryItems];
+ XCTAssertEqualObjects([FIRAuthWebUtils queryItemValue:@"ibi" from:queryItems],
+ kFakeBundleID);
+ XCTAssertEqualObjects([FIRAuthWebUtils queryItemValue:@"clientId" from:queryItems],
+ kFakeClientID);
+ XCTAssertEqualObjects([FIRAuthWebUtils queryItemValue:@"apiKey" from:queryItems],
+ kFakeAPIKey);
+ XCTAssertEqualObjects([FIRAuthWebUtils queryItemValue:@"authType" from:queryItems],
+ @"verifyApp");
+ XCTAssertNotNil([FIRAuthWebUtils queryItemValue:@"v" from:queryItems]);
// `callbackMatcher` is at index 4
[invocation getArgument:&unretainedArgument atIndex:4];
FIRAuthURLCallbackMatcher callbackMatcher = unretainedArgument;
@@ -423,7 +430,8 @@ static const NSTimeInterval kExpectationTimeout = 2;
// 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"]];
+ [redirectURL appendString:[FIRAuthWebUtils queryItemValue:@"eventId"
+ from:queryItems]];
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]));