aboutsummaryrefslogtreecommitdiffhomepage
path: root/Example
diff options
context:
space:
mode:
authorGravatar Chen Liang <chliang@google.com>2018-06-19 14:08:53 -0700
committerGravatar GitHub <noreply@github.com>2018-06-19 14:08:53 -0700
commit69ccd6d8b18b833acfd47ce251f05e94000e6ff5 (patch)
treec6f9f3ac6632940022cbd19c17f34fe0b8390536 /Example
parentfb9482c303a3f53c2f16eb41a8614f2d4302a9e3 (diff)
Corrected the deprecation warning when subscribing to or unsubscribing from a topic (#1425)
Diffstat (limited to 'Example')
-rw-r--r--Example/Messaging/Tests/FIRMessagingPubSubTest.m9
1 files changed, 9 insertions, 0 deletions
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