1
0
Fork 0
mirror of synced 2024-09-29 08:51:28 +13:00
This commit is contained in:
Jake Barnby 2024-02-21 13:16:25 +13:00
parent 52d4b649e4
commit 81d475d98b
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -444,6 +444,17 @@ trait MessagingBase
$this->assertEquals($target['body']['userId'], $response['body']['target']['userId']);
$this->assertEquals($target['body']['providerType'], $response['body']['target']['providerType']);
// Test duplicate subscribers not allowed
$response = $this->client->call(Client::METHOD_POST, '/messaging/topics/' . $topics['public']['$id'] . '/subscribers', \array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'subscriberId' => ID::unique(),
'targetId' => $target['body']['$id'],
]);
$this->assertEquals(409, $response['headers']['status-code']);
$topic = $this->client->call(Client::METHOD_GET, '/messaging/topics/' . $topics['public']['$id'], [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],