mirror of
https://github.com/zhigang1992/facebook-ios-sdk.git
synced 2026-01-12 17:22:28 +08:00
Clean up and simplify testing use of graph requests and their creation
Reviewed By: josueBrizuelaXD Differential Revision: D39833084 fbshipit-source-id: d838b2ad032e97d11f55eed9001e2613a0edfa14
This commit is contained in:
committed by
Facebook GitHub Bot
parent
77ec522a48
commit
d5d8c9a24e
@@ -162,7 +162,7 @@ final class AppLinkUtilityTests: XCTestCase {
|
||||
appEventsConfigurationProvider.firstCapturedBlock?()
|
||||
|
||||
XCTAssertEqual(graphRequestFactory.capturedGraphPath, "(null)/activities")
|
||||
XCTAssertEqual(graphRequestFactory.capturedHttpMethod, HTTPMethod(rawValue: "POST"))
|
||||
XCTAssertEqual(graphRequestFactory.capturedHTTPMethod, .post)
|
||||
}
|
||||
|
||||
func testValidatingConfiguration() {
|
||||
|
||||
@@ -455,7 +455,7 @@ final class GraphRequestConnectionTests: XCTestCase, GraphRequestConnectionDeleg
|
||||
func testAddingRequestToBatchSetsMethod() {
|
||||
let postRequest = TestGraphRequest(
|
||||
graphPath: "me",
|
||||
HTTPMethod: .post
|
||||
httpMethod: .post
|
||||
)
|
||||
let metadata = GraphRequestMetadata(
|
||||
request: postRequest,
|
||||
@@ -1297,7 +1297,7 @@ final class GraphRequestConnectionTests: XCTestCase, GraphRequestConnectionDeleg
|
||||
let parameters: [String: Any] = [
|
||||
"first_key": "first_value",
|
||||
]
|
||||
let singleRequest = TestGraphRequest(graphPath: "activities", parameters: parameters, HTTPMethod: .post)
|
||||
let singleRequest = TestGraphRequest(graphPath: "activities", parameters: parameters, httpMethod: .post)
|
||||
connection.add(singleRequest) { _, _, _ in }
|
||||
let requests = try XCTUnwrap(connection.requests as? [GraphRequestMetadata])
|
||||
let request = connection.request(withBatch: requests, timeout: 0)
|
||||
@@ -1325,7 +1325,7 @@ final class GraphRequestConnectionTests: XCTestCase, GraphRequestConnectionDeleg
|
||||
graphPath: "me",
|
||||
parameters: ["fields": ""],
|
||||
tokenString: expectedToken,
|
||||
HTTPMethod: .get,
|
||||
httpMethod: .get,
|
||||
flags: []
|
||||
)
|
||||
let token = connection.accessToken(with: request)
|
||||
|
||||
@@ -84,8 +84,8 @@ final class AppEventsConfigurationManagerTests: XCTestCase {
|
||||
settings,
|
||||
"Should be able to configure with custom settings"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
manager.graphRequestFactory as? TestGraphRequestFactory,
|
||||
XCTAssertIdentical(
|
||||
manager.graphRequestFactory as AnyObject,
|
||||
graphRequestFactory,
|
||||
"Should be able to configure with a custom graph request provider"
|
||||
)
|
||||
@@ -143,12 +143,11 @@ final class AppEventsConfigurationManagerTests: XCTestCase {
|
||||
"Should not include a token string in the request"
|
||||
)
|
||||
XCTAssertNil(
|
||||
graphRequestFactory.capturedHttpMethod,
|
||||
graphRequestFactory.capturedHTTPMethod,
|
||||
"Should not specify an http method when creating the request"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
XCTAssertNil(
|
||||
graphRequestFactory.capturedFlags,
|
||||
[],
|
||||
"Should not specify flags when creating the request"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -971,7 +971,7 @@ final class AppEventsTests: XCTestCase {
|
||||
"Should include the access token in the request when there is one available"
|
||||
)
|
||||
XCTAssertNil(
|
||||
graphRequestFactory.capturedParameters["udid"],
|
||||
graphRequestFactory.capturedParameters?["udid"],
|
||||
"Should not include the udid in the request when there is none available"
|
||||
)
|
||||
}
|
||||
@@ -994,7 +994,7 @@ final class AppEventsTests: XCTestCase {
|
||||
"Should include the access token in the request when there is one available"
|
||||
)
|
||||
XCTAssertNil(
|
||||
graphRequestFactory.capturedParameters["udid"],
|
||||
graphRequestFactory.capturedParameters?["udid"],
|
||||
"Should not include the udid in the request when there is an access token available"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
@@ -1003,7 +1003,7 @@ final class AppEventsTests: XCTestCase {
|
||||
"Should use the expected graph path for the request"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
graphRequestFactory.capturedHttpMethod,
|
||||
graphRequestFactory.capturedHTTPMethod,
|
||||
.get,
|
||||
"Should use the expected http method for the request"
|
||||
)
|
||||
|
||||
@@ -28,9 +28,9 @@ final class FBSDKAppEventsCAPIManagerTests: XCTestCase {
|
||||
}
|
||||
|
||||
func testConfigure() {
|
||||
XCTAssertEqual(
|
||||
factory,
|
||||
FBSDKAppEventsCAPIManager.shared.factory as? TestGraphRequestFactory,
|
||||
XCTAssertIdentical(
|
||||
factory as AnyObject,
|
||||
FBSDKAppEventsCAPIManager.shared.factory,
|
||||
"Should configure with the expected graph request factory"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
|
||||
@@ -102,8 +102,8 @@ final class CodelessIndexerTests: XCTestCase {
|
||||
}
|
||||
|
||||
func testConfiguringWithDependencies() {
|
||||
XCTAssertEqual(
|
||||
_CodelessIndexer.graphRequestFactory as? TestGraphRequestFactory,
|
||||
XCTAssertIdentical(
|
||||
_CodelessIndexer.graphRequestFactory as AnyObject,
|
||||
graphRequestFactory,
|
||||
"Should be able to configure with a request provider"
|
||||
)
|
||||
@@ -168,7 +168,7 @@ final class CodelessIndexerTests: XCTestCase {
|
||||
"Should not include a token string in the request"
|
||||
)
|
||||
XCTAssertNil(
|
||||
graphRequestFactory.capturedHttpMethod,
|
||||
graphRequestFactory.capturedHTTPMethod,
|
||||
"Should not specify an http method when creating the request"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
@@ -468,7 +468,7 @@ final class CodelessIndexerTests: XCTestCase {
|
||||
"Should create a request with the expected graph path"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
graphRequestFactory.capturedHttpMethod,
|
||||
graphRequestFactory.capturedHTTPMethod,
|
||||
.post,
|
||||
"Should create a request with the expected http method"
|
||||
)
|
||||
@@ -485,9 +485,8 @@ final class CodelessIndexerTests: XCTestCase {
|
||||
],
|
||||
"Should create a request with the expected parameters"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
XCTAssertNil(
|
||||
graphRequestFactory.capturedFlags,
|
||||
[],
|
||||
"Should create a request with the expected flags"
|
||||
)
|
||||
}
|
||||
@@ -595,7 +594,7 @@ final class CodelessIndexerTests: XCTestCase {
|
||||
"Should request the session with the expected parameters"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
graphRequestFactory.capturedHttpMethod,
|
||||
graphRequestFactory.capturedHTTPMethod,
|
||||
.post,
|
||||
"Should request the session with the expected http method"
|
||||
)
|
||||
|
||||
@@ -288,7 +288,7 @@ final class SuggestedEventsIndexerTests: XCTestCase, UITableViewDelegate, UIColl
|
||||
|
||||
let expectedMetadata = [Keys.dense: Values.denseFeature, Keys.buttonText: Values.buttonText]
|
||||
guard
|
||||
let parameter = graphRequestFactory.capturedParameters[Keys.metadata] as? String,
|
||||
let parameter = graphRequestFactory.capturedParameters?[Keys.metadata] as? String,
|
||||
let data = parameter.data(using: .utf8),
|
||||
let decodedMetadata = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: String]
|
||||
else {
|
||||
@@ -301,7 +301,7 @@ final class SuggestedEventsIndexerTests: XCTestCase, UITableViewDelegate, UIColl
|
||||
"Should use the app identifier from the settings"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
graphRequestFactory.capturedParameters[Keys.eventName] as? String,
|
||||
graphRequestFactory.capturedParameters?[Keys.eventName] as? String,
|
||||
name,
|
||||
"Should capture the event name in the parameters"
|
||||
)
|
||||
@@ -315,12 +315,12 @@ final class SuggestedEventsIndexerTests: XCTestCase, UITableViewDelegate, UIColl
|
||||
"The request should be tokenless"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
graphRequestFactory.capturedHttpMethod,
|
||||
graphRequestFactory.capturedHTTPMethod,
|
||||
.post,
|
||||
"Should use the expected http method"
|
||||
)
|
||||
XCTAssertTrue(
|
||||
graphRequestFactory.capturedFlags.isEmpty,
|
||||
XCTAssertNil(
|
||||
graphRequestFactory.capturedFlags,
|
||||
"Should not create the request with explicit request flags"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ final class ErrorReporterTests: XCTestCase {
|
||||
reporter.uploadErrors()
|
||||
|
||||
guard
|
||||
let reports = factory.capturedParameters["error_reports"] as? String,
|
||||
let reports = factory.capturedParameters?["error_reports"] as? String,
|
||||
let data = reports.data(using: .utf8)
|
||||
else {
|
||||
return XCTFail("Should upload reports as an array of strings")
|
||||
@@ -242,7 +242,7 @@ final class ErrorReporterTests: XCTestCase {
|
||||
"Should upload the expected reports"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
factory.capturedHttpMethod,
|
||||
factory.capturedHTTPMethod,
|
||||
.post,
|
||||
"Should use the correct http method"
|
||||
)
|
||||
|
||||
@@ -262,14 +262,14 @@ final class GateKeeperManagerTests: XCTestCase {
|
||||
"\(appIdentifier)/mobile_sdk_gk",
|
||||
"Should use the app identifier from the settings"
|
||||
)
|
||||
XCTAssertEqual(graphRequestFactory.capturedParameters["platform"] as? String, "ios")
|
||||
XCTAssertEqual(graphRequestFactory.capturedParameters?["platform"] as? String, "ios")
|
||||
XCTAssertEqual(
|
||||
graphRequestFactory.capturedParameters["sdk_version"] as? String,
|
||||
graphRequestFactory.capturedParameters?["sdk_version"] as? String,
|
||||
version,
|
||||
"Should use the sdk version from the settings"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
graphRequestFactory.capturedParameters["fields"] as? String,
|
||||
graphRequestFactory.capturedParameters?["fields"] as? String,
|
||||
"gatekeepers",
|
||||
"Should request the expected fields"
|
||||
)
|
||||
@@ -278,7 +278,7 @@ final class GateKeeperManagerTests: XCTestCase {
|
||||
"The gate keepers request should be tokenless"
|
||||
)
|
||||
XCTAssertNil(
|
||||
graphRequestFactory.capturedHttpMethod,
|
||||
graphRequestFactory.capturedHTTPMethod,
|
||||
"Should not provide an explicit http method"
|
||||
)
|
||||
XCTAssertEqual(
|
||||
|
||||
@@ -45,8 +45,8 @@ final class CustomUpdateGraphRequestTests: XCTestCase {
|
||||
}
|
||||
|
||||
func testCustomDependencies() {
|
||||
XCTAssertEqual(
|
||||
requester.graphRequestFactory as? TestGraphRequestFactory,
|
||||
XCTAssertIdentical(
|
||||
requester.graphRequestFactory as AnyObject,
|
||||
factory,
|
||||
"Should be able to create with a custom graph request factory"
|
||||
)
|
||||
|
||||
@@ -56,8 +56,8 @@ final class TournamentFetcherTests: XCTestCase {
|
||||
}
|
||||
|
||||
func testCustomDependencies() {
|
||||
XCTAssertEqual(
|
||||
fetcher.graphRequestFactory as? TestGraphRequestFactory,
|
||||
XCTAssertIdentical(
|
||||
fetcher.graphRequestFactory as AnyObject,
|
||||
factory,
|
||||
"Should be able to create with a custom graph request factory"
|
||||
)
|
||||
|
||||
@@ -40,8 +40,8 @@ final class TournamentUpdaterTest: XCTestCase {
|
||||
}
|
||||
|
||||
func testCustomDependencies() {
|
||||
XCTAssertEqual(
|
||||
updater.graphRequestFactory as? TestGraphRequestFactory,
|
||||
XCTAssertIdentical(
|
||||
updater.graphRequestFactory as AnyObject,
|
||||
factory,
|
||||
"Should be able to create with a custom graph request factory"
|
||||
)
|
||||
|
||||
@@ -86,7 +86,7 @@ final class VideoUploaderTests: XCTestCase, VideoUploaderDelegate {
|
||||
graphRequestFactory.capturedGraphPath,
|
||||
"me/videos"
|
||||
)
|
||||
XCTAssertNotNil(graphRequestFactory.capturedHttpMethod)
|
||||
XCTAssertNotNil(graphRequestFactory.capturedHTTPMethod)
|
||||
XCTAssertNil(
|
||||
graphRequestFactory.capturedTokenString,
|
||||
"Request Provider should not be initialized with a token string"
|
||||
|
||||
@@ -7,110 +7,35 @@
|
||||
*/
|
||||
|
||||
@testable import FBSDKCoreKit
|
||||
import Foundation
|
||||
|
||||
@objcMembers
|
||||
public final class TestGraphRequest: NSObject, GraphRequestProtocol {
|
||||
public final class TestGraphRequest: GraphRequestProtocol {
|
||||
public var isGraphErrorRecoveryDisabled = false
|
||||
public var hasAttachments = false
|
||||
public var parameters: [String: Any] = [:]
|
||||
public var tokenString: String?
|
||||
public var graphPath: String = ""
|
||||
public var httpMethod = HTTPMethod.get
|
||||
public var version: String = ""
|
||||
public var flags: GraphRequestFlags = []
|
||||
public let hasAttachments = false
|
||||
public var parameters: [String: Any]
|
||||
public let tokenString: String?
|
||||
public let graphPath: String
|
||||
public let httpMethod: HTTPMethod
|
||||
public let version: String
|
||||
public let flags: GraphRequestFlags
|
||||
public var stubbedConnection = TestGraphRequestConnection()
|
||||
public var capturedCompletionHandler: GraphRequestCompletion?
|
||||
public var startCallCount = 0
|
||||
public var cancelCallCount = 0
|
||||
|
||||
public convenience init(
|
||||
graphPath: String,
|
||||
HTTPMethod: HTTPMethod
|
||||
public init(
|
||||
graphPath: String = "",
|
||||
parameters: [String: Any]? = nil,
|
||||
tokenString: String? = nil,
|
||||
httpMethod: HTTPMethod? = nil,
|
||||
version: String? = nil,
|
||||
flags: GraphRequestFlags? = nil
|
||||
) {
|
||||
self.init()
|
||||
|
||||
self.graphPath = graphPath
|
||||
httpMethod = HTTPMethod
|
||||
}
|
||||
|
||||
public convenience init(
|
||||
graphPath: String,
|
||||
parameters: [String: Any]
|
||||
) {
|
||||
self.init()
|
||||
|
||||
self.graphPath = graphPath
|
||||
self.parameters = parameters
|
||||
}
|
||||
|
||||
public convenience init(
|
||||
graphPath: String,
|
||||
parameters: [String: Any],
|
||||
HTTPMethod: HTTPMethod
|
||||
) {
|
||||
self.init()
|
||||
|
||||
self.graphPath = graphPath
|
||||
self.parameters = parameters
|
||||
httpMethod = HTTPMethod
|
||||
}
|
||||
|
||||
public convenience init(
|
||||
graphPath: String,
|
||||
parameters: [String: Any],
|
||||
flags: GraphRequestFlags
|
||||
) {
|
||||
self.init()
|
||||
|
||||
self.graphPath = graphPath
|
||||
self.parameters = parameters
|
||||
self.flags = flags
|
||||
}
|
||||
|
||||
public convenience init(
|
||||
graphPath: String,
|
||||
parameters: [String: Any],
|
||||
tokenString: String?
|
||||
) {
|
||||
self.init()
|
||||
|
||||
self.graphPath = graphPath
|
||||
self.parameters = parameters
|
||||
self.parameters = parameters ?? [:]
|
||||
self.tokenString = tokenString
|
||||
}
|
||||
|
||||
public convenience init(
|
||||
graphPath: String,
|
||||
parameters: [String: Any],
|
||||
tokenString: String?,
|
||||
HTTPMethod: HTTPMethod,
|
||||
flags: GraphRequestFlags
|
||||
) {
|
||||
self.init()
|
||||
|
||||
self.graphPath = graphPath
|
||||
self.parameters = parameters
|
||||
self.tokenString = tokenString
|
||||
self.graphPath = graphPath
|
||||
httpMethod = HTTPMethod
|
||||
self.flags = flags
|
||||
}
|
||||
|
||||
public convenience init(
|
||||
graphPath: String,
|
||||
parameters: [String: Any],
|
||||
tokenString: String?,
|
||||
HTTPMethod: HTTPMethod,
|
||||
version: String
|
||||
) {
|
||||
self.init()
|
||||
|
||||
self.parameters = parameters
|
||||
self.tokenString = tokenString
|
||||
self.graphPath = graphPath
|
||||
httpMethod = HTTPMethod
|
||||
self.version = version
|
||||
self.httpMethod = httpMethod ?? .get
|
||||
self.version = version ?? ""
|
||||
self.flags = flags ?? []
|
||||
}
|
||||
|
||||
public func start(completion handler: GraphRequestCompletion? = nil) -> GraphRequestConnecting {
|
||||
|
||||
@@ -7,60 +7,47 @@
|
||||
*/
|
||||
|
||||
import FBSDKCoreKit
|
||||
import Foundation
|
||||
|
||||
@objcMembers
|
||||
public final class TestGraphRequestFactory: NSObject, GraphRequestFactoryProtocol {
|
||||
public final class TestGraphRequestFactory: GraphRequestFactoryProtocol {
|
||||
|
||||
public var stubbedGraphRequest: TestGraphRequest?
|
||||
|
||||
public var capturedGraphPath: String?
|
||||
public var capturedParameters = [String: Any]()
|
||||
public var capturedParameters: [String: Any]?
|
||||
public var capturedTokenString: String?
|
||||
public var capturedHttpMethod: HTTPMethod?
|
||||
public var capturedFlags: GraphRequestFlags = []
|
||||
public var capturedHTTPMethod: HTTPMethod?
|
||||
public var capturedFlags: GraphRequestFlags?
|
||||
public var capturedVersion: String?
|
||||
public var capturedRequests = [TestGraphRequest]()
|
||||
|
||||
// MARK: - GraphRequestFactoryProtocol
|
||||
public init() {}
|
||||
|
||||
public func createGraphRequest(
|
||||
withGraphPath graphPath: String,
|
||||
parameters: [String: Any],
|
||||
tokenString: String?,
|
||||
httpMethod method: HTTPMethod?,
|
||||
httpMethod: HTTPMethod?,
|
||||
flags: GraphRequestFlags
|
||||
) -> GraphRequestProtocol {
|
||||
capturedGraphPath = graphPath
|
||||
capturedParameters = parameters
|
||||
capturedTokenString = tokenString
|
||||
capturedHttpMethod = method
|
||||
capturedFlags = flags
|
||||
|
||||
let request = TestGraphRequest(
|
||||
makeRequest(
|
||||
graphPath: graphPath,
|
||||
parameters: parameters,
|
||||
tokenString: tokenString,
|
||||
HTTPMethod: method ?? .get,
|
||||
httpMethod: httpMethod,
|
||||
flags: flags
|
||||
)
|
||||
capturedRequests.append(request)
|
||||
return request
|
||||
}
|
||||
|
||||
public func createGraphRequest(
|
||||
withGraphPath graphPath: String,
|
||||
parameters: [String: Any],
|
||||
httpMethod method: HTTPMethod
|
||||
httpMethod: HTTPMethod
|
||||
) -> GraphRequestProtocol {
|
||||
capturedGraphPath = graphPath
|
||||
capturedParameters = parameters
|
||||
capturedHttpMethod = method
|
||||
|
||||
let request = TestGraphRequest(
|
||||
makeRequest(
|
||||
graphPath: graphPath,
|
||||
parameters: parameters,
|
||||
HTTPMethod: method
|
||||
httpMethod: httpMethod
|
||||
)
|
||||
capturedRequests.append(request)
|
||||
return request
|
||||
}
|
||||
|
||||
public func createGraphRequest(
|
||||
@@ -68,48 +55,26 @@ public final class TestGraphRequestFactory: NSObject, GraphRequestFactoryProtoco
|
||||
parameters: [String: Any],
|
||||
tokenString: String?,
|
||||
version: String?,
|
||||
httpMethod method: HTTPMethod
|
||||
httpMethod: HTTPMethod
|
||||
) -> GraphRequestProtocol {
|
||||
capturedGraphPath = graphPath
|
||||
capturedParameters = parameters
|
||||
capturedTokenString = tokenString
|
||||
capturedHttpMethod = method
|
||||
|
||||
let request = TestGraphRequest(
|
||||
makeRequest(
|
||||
graphPath: graphPath,
|
||||
parameters: parameters,
|
||||
tokenString: tokenString,
|
||||
HTTPMethod: method,
|
||||
flags: []
|
||||
version: version,
|
||||
httpMethod: httpMethod
|
||||
)
|
||||
capturedRequests.append(request)
|
||||
return request
|
||||
}
|
||||
|
||||
public func createGraphRequest(
|
||||
withGraphPath graphPath: String
|
||||
) -> GraphRequestProtocol {
|
||||
capturedGraphPath = graphPath
|
||||
|
||||
let request = TestGraphRequest(graphPath: graphPath, HTTPMethod: .get)
|
||||
capturedRequests.append(request)
|
||||
return request
|
||||
public func createGraphRequest(withGraphPath graphPath: String) -> GraphRequestProtocol {
|
||||
makeRequest(graphPath: graphPath)
|
||||
}
|
||||
|
||||
public func createGraphRequest(
|
||||
withGraphPath graphPath: String,
|
||||
parameters: [String: Any]
|
||||
) -> GraphRequestProtocol {
|
||||
capturedGraphPath = graphPath
|
||||
capturedParameters = parameters
|
||||
|
||||
let request = TestGraphRequest(
|
||||
graphPath: graphPath,
|
||||
parameters: parameters,
|
||||
HTTPMethod: .get
|
||||
)
|
||||
capturedRequests.append(request)
|
||||
return request
|
||||
makeRequest(graphPath: graphPath, parameters: parameters)
|
||||
}
|
||||
|
||||
public func createGraphRequest(
|
||||
@@ -117,18 +82,35 @@ public final class TestGraphRequestFactory: NSObject, GraphRequestFactoryProtoco
|
||||
parameters: [String: Any],
|
||||
flags: GraphRequestFlags
|
||||
) -> GraphRequestProtocol {
|
||||
makeRequest(graphPath: graphPath, parameters: parameters, flags: flags)
|
||||
}
|
||||
|
||||
private func makeRequest(
|
||||
graphPath: String,
|
||||
parameters: [String: Any]? = nil,
|
||||
tokenString: String? = nil,
|
||||
version: String? = nil,
|
||||
httpMethod: HTTPMethod? = nil,
|
||||
flags: GraphRequestFlags? = nil
|
||||
) -> TestGraphRequest {
|
||||
capturedGraphPath = graphPath
|
||||
capturedParameters = parameters
|
||||
capturedTokenString = tokenString
|
||||
capturedVersion = version
|
||||
capturedHTTPMethod = httpMethod
|
||||
capturedFlags = flags
|
||||
|
||||
let request = TestGraphRequest(
|
||||
let newRequest = TestGraphRequest(
|
||||
graphPath: graphPath,
|
||||
parameters: parameters,
|
||||
tokenString: nil,
|
||||
HTTPMethod: .get,
|
||||
tokenString: tokenString,
|
||||
httpMethod: httpMethod,
|
||||
version: version,
|
||||
flags: flags
|
||||
)
|
||||
capturedRequests.append(request)
|
||||
return request
|
||||
|
||||
let returnedRequest = stubbedGraphRequest ?? newRequest
|
||||
capturedRequests.append(returnedRequest)
|
||||
return returnedRequest
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user