Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ @interface FIRMessagingRemoteNotificationsProxyTest : XCTestCase
@property(nonatomic, strong) id mockProxyClass;
@property(nonatomic, strong) id mockMessaging;
@property(nonatomic, strong) id mockUserNotificationCenter;
@property(nonatomic, strong) UNUserNotificationCenter *currentNotificationCenter;

@end

Expand All @@ -147,8 +148,13 @@ - (void)setUp {
OCMStub([_mockProxyClass sharedProxy]).andReturn(self.proxy);
if (@available(macOS 10.14, iOS 10.0, *)) {
_mockUserNotificationCenter = OCMClassMock([UNUserNotificationCenter class]);
_currentNotificationCenter = _mockUserNotificationCenter;
OCMStub([_mockUserNotificationCenter currentNotificationCenter])
.andReturn(_mockUserNotificationCenter);
.andDo(^(NSInvocation *invocation) {
__autoreleasing UNUserNotificationCenter *currentNotificationCenter =
self->_currentNotificationCenter;
[invocation setReturnValue:&currentNotificationCenter];
});
}
}

Expand Down
Loading