From 69ccd6d8b18b833acfd47ce251f05e94000e6ff5 Mon Sep 17 00:00:00 2001 From: Chen Liang Date: Tue, 19 Jun 2018 14:08:53 -0700 Subject: Corrected the deprecation warning when subscribing to or unsubscribing from a topic (#1425) --- Example/Messaging/Tests/FIRMessagingPubSubTest.m | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Example') diff --git a/Example/Messaging/Tests/FIRMessagingPubSubTest.m b/Example/Messaging/Tests/FIRMessagingPubSubTest.m index 3af1402..e1260f5 100644 --- a/Example/Messaging/Tests/FIRMessagingPubSubTest.m +++ b/Example/Messaging/Tests/FIRMessagingPubSubTest.m @@ -78,4 +78,13 @@ static NSString *const kTopicName = @"topic-Name"; XCTAssertTrue([FIRMessagingPubSub isValidTopicWithPrefix:topic]); } +- (void)testRemoveTopicPrefix { + NSString *topic = [NSString stringWithFormat:@"/topics/%@", kTopicName]; + topic = [FIRMessagingPubSub removePrefixFromTopic:topic]; + XCTAssertEqualObjects(topic, kTopicName); + // if the topic doesn't have the prefix, should return topic itself. + topic = [FIRMessagingPubSub removePrefixFromTopic:kTopicName]; + XCTAssertEqualObjects(topic, kTopicName); +} + @end -- cgit v1.2.3