File tree 1 file changed +7
-1
lines changed
FirebaseMessaging/Tests/UnitTests
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ @interface FIRMessagingRemoteNotificationsProxyTest : XCTestCase
128
128
@property (nonatomic , strong ) id mockProxyClass;
129
129
@property (nonatomic , strong ) id mockMessaging;
130
130
@property (nonatomic , strong ) id mockUserNotificationCenter;
131
+ @property (nonatomic , strong ) UNUserNotificationCenter *currentNotificationCenter;
131
132
132
133
@end
133
134
@@ -147,8 +148,13 @@ - (void)setUp {
147
148
OCMStub ([_mockProxyClass sharedProxy ]).andReturn (self.proxy );
148
149
if (@available (macOS 10.14 , iOS 10.0 , *)) {
149
150
_mockUserNotificationCenter = OCMClassMock ([UNUserNotificationCenter class ]);
151
+ _currentNotificationCenter = _mockUserNotificationCenter;
150
152
OCMStub ([_mockUserNotificationCenter currentNotificationCenter ])
151
- .andReturn (_mockUserNotificationCenter);
153
+ .andDo (^(NSInvocation *invocation) {
154
+ __autoreleasing UNUserNotificationCenter *currentNotificationCenter =
155
+ self->_currentNotificationCenter ;
156
+ [invocation setReturnValue: ¤tNotificationCenter];
157
+ });
152
158
}
153
159
}
154
160
You can’t perform that action at this time.
0 commit comments