Skip to content

Commit 71a001e

Browse files
FCM: fix distant future date in the tests. (#4667)
1 parent 2ffc2f3 commit 71a001e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Example/Messaging/Tests/FIRMessagingContextManagerServiceTest.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ - (void)testValidContextManagerMessage {
7272
- (void)testMessageWithFutureStartTime {
7373
#if TARGET_OS_IOS
7474
NSString *messageIdentifier = @"fcm-cm-test1";
75-
NSString *startTimeString = @"2020-01-12 12:00:00"; // way into the future
75+
// way into the future
76+
NSString *startTimeString = [self.dateFormatter stringFromDate:[NSDate distantFuture]];
7677
NSDictionary *message = @{
7778
kFIRMessagingContextManagerLocalTimeStart: startTimeString,
7879
kFIRMessagingContextManagerBodyKey : @"Hello world!",
@@ -154,7 +155,8 @@ - (void)testTimedNotificationsUserInfo {
154155
#if TARGET_OS_IOS
155156
NSString *messageIdentifierKey = @"message.id";
156157
NSString *messageIdentifier = @"fcm-cm-test1";
157-
NSString *startTimeString = @"2020-01-12 12:00:00"; // way into the future
158+
// way into the future
159+
NSString *startTimeString = [self.dateFormatter stringFromDate:[NSDate distantFuture]];
158160

159161
NSString *customDataKey = @"hello";
160162
NSString *customData = @"world";

0 commit comments

Comments
 (0)