File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
FirebaseMessaging/Tests/UnitTests Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ @interface FIRMessagingRemoteNotificationsProxyTest : XCTestCase
128128@property (nonatomic , strong ) id mockProxyClass;
129129@property (nonatomic , strong ) id mockMessaging;
130130@property (nonatomic , strong ) id mockUserNotificationCenter;
131+ @property (nonatomic , strong ) UNUserNotificationCenter *currentNotificationCenter;
131132
132133@end
133134
@@ -147,8 +148,13 @@ - (void)setUp {
147148 OCMStub ([_mockProxyClass sharedProxy ]).andReturn (self.proxy );
148149 if (@available (macOS 10.14 , iOS 10.0 , *)) {
149150 _mockUserNotificationCenter = OCMClassMock ([UNUserNotificationCenter class ]);
151+ _currentNotificationCenter = _mockUserNotificationCenter;
150152 OCMStub ([_mockUserNotificationCenter currentNotificationCenter ])
151- .andReturn (_mockUserNotificationCenter);
153+ .andDo (^(NSInvocation *invocation) {
154+ __autoreleasing UNUserNotificationCenter *currentNotificationCenter =
155+ self->_currentNotificationCenter ;
156+ [invocation setReturnValue: ¤tNotificationCenter];
157+ });
152158 }
153159}
154160
You can’t perform that action at this time.
0 commit comments