| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- /*
- * Copyright 2021 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- #import <Foundation/Foundation.h>
- NS_ASSUME_NONNULL_BEGIN
- /**
- * @class GIDFakeMainBundle
- * @brief Helps fake [NSBundle mainBundle]
- */
- @interface GIDFakeMainBundle : NSObject
- /**
- * @fn initWithClientID:serverClientID:hostedDomain:openIDRealm:
- * @brief Initializes a GIDFakeMainBundle object.
- * @param clientID The fake client idenfitier for the app.
- * @param serverClientID The fake server client idenfitier for the app.
- * @param hostedDomain The fake hosted domain for the app.
- * @param openIDRealm The fake OpenID realm for the app.
- */
- - (instancetype)initWithClientID:(nullable id)clientID
- serverClientID:(nullable id)serverClientID
- hostedDomain:(nullable id)hostedDomain
- openIDRealm:(nullable id)openIDRealm
- NS_DESIGNATED_INITIALIZER;
- /**
- * @fn init:
- * @brief Initializes a GIDFakeMainBundle object with `nil` to all of the designated initializer's parameters.
- */
- - (instancetype)init;
- /**
- * @fn startFaking:
- * @brief Starts faking [NSBundle mainBundle]
- */
- - (void)startFaking;
- /**
- * @fn startFakingWithClientID:
- * @brief Starts faking [NSBundle mainBundle]
- * @param clientID The fake client idenfitier for the app.
- */
- - (void)startFakingWithClientID:(nullable NSString *)clientID;
- /**
- * @fn stopFaking
- * @brief Stops faking [NSBundle mainBundle]
- */
- - (void)stopFaking;
- #pragma mark - URL Schemes
- /**
- * @fn fakeAllSchemesSupported
- * @brief Fakes all URL schemes in the info.plist.
- */
- - (void)fakeAllSchemesSupported;
- /**
- * @fn fakeAllSchemesSupportedAndMerged
- * @brief Fakes all URL schemes in the info.plist as a single scheme definition.
- */
- - (void)fakeAllSchemesSupportedAndMerged;
- /**
- * @fn fakeAllSchemesSupportedWithCasesMangled
- * @brief Fakes all URL schemes in the info.plist but flips A-Z with a-z and vice-versa.
- */
- - (void)fakeAllSchemesSupportedWithCasesMangled;
- /**
- * @fn fakeMissingClientIdScheme
- * @brief Fakes a missing client ID scheme in the info.plist.
- */
- - (void)fakeMissingClientIdScheme;
- /**
- * @fn fakeMissingAllSchemes
- * @brief Fakes missing the CFBundleURLTypes section of the info.plist entirely.
- */
- - (void)fakeMissingAllSchemes;
- /**
- * @fn fakeOtherSchemes
- * @brief Fakes other irrelevant schemes in the info.plist.
- */
- - (void)fakeOtherSchemes;
- /**
- * @fn fakeOtherSchemesAndAllSchemes
- * @brief Fakes other irrelevant schemes in the info.plist.
- */
- - (void)fakeOtherSchemesAndAllSchemes;
- /**
- * @fn fakeWithClientID:serverClientID:hostedDomain:openIDRealm:
- * @brief Sets values for faked Info.plist params.
- * @param clientID The fake client idenfitier for the app.
- * @param serverClientID The fake server client idenfitier for the app.
- * @param hostedDomain The fake hosted domain for the app.
- * @param openIDRealm The fake OpenID realm for the app.
- */
- - (void)fakeWithClientID:(nullable id)clientID
- serverClientID:(nullable id)serverClientID
- hostedDomain:(nullable id)hostedDomain
- openIDRealm:(nullable id)openIDRealm;
- @end
- NS_ASSUME_NONNULL_END
|