Skip to content

Commit 2a9008a

Browse files
authored
Fix portability of new test (#4923)
1 parent ddaeaa2 commit 2a9008a

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

FirebaseRemoteConfig/Tests/Unit/RCNRemoteConfigTest.m

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#import <FirebaseCore/FIRLogger.h>
3030
#import <FirebaseCore/FIROptions.h>
3131
#import <GoogleUtilities/GULNSData+zlib.h>
32+
#import <OCMock/OCMStubRecorder.h>
3233
#import <OCMock/OCMock.h>
3334

3435
@interface RCNConfigFetch (ForTest)
@@ -192,14 +193,15 @@ - (void)setUp {
192193
namespace:fullyQualifiedNamespace
193194
options:currentOptions]);
194195

195-
OCMStub([_configFetch[i] fetchConfigWithExpirationDuration:0 completionHandler:OCMOCK_ANY])
196-
.ignoringNonObjectArgs()
197-
.andDo(^(NSInvocation *invocation) {
198-
void (^handler)(FIRRemoteConfigFetchStatus status, NSError *_Nullable error) = nil;
199-
[invocation getArgument:&handler atIndex:3];
200-
[_configFetch[i] fetchWithUserProperties:[[NSDictionary alloc] init]
201-
completionHandler:handler];
202-
});
196+
OCMStubRecorder *mock = OCMStub([_configFetch[i] fetchConfigWithExpirationDuration:0
197+
completionHandler:OCMOCK_ANY]);
198+
mock = [mock ignoringNonObjectArgs];
199+
mock.andDo(^(NSInvocation *invocation) {
200+
void (^handler)(FIRRemoteConfigFetchStatus status, NSError *_Nullable error) = nil;
201+
[invocation getArgument:&handler atIndex:3];
202+
[_configFetch[i] fetchWithUserProperties:[[NSDictionary alloc] init]
203+
completionHandler:handler];
204+
});
203205

204206
_response[i] = @{@"state" : @"UPDATE", @"entries" : _entries[i]};
205207

0 commit comments

Comments
 (0)