Merge branch '1.5.x' into feat-push-images
This commit is contained in:
commit
9b251207cf
2 changed files with 18 additions and 0 deletions
|
@ -2113,6 +2113,13 @@ $commonCollections = [
|
|||
'lengths' => [],
|
||||
'orders' => [],
|
||||
],
|
||||
[
|
||||
'$id' => ID::custom('_unique_target_topic'),
|
||||
'type' => Database::INDEX_UNIQUE,
|
||||
'attributes' => ['targetInternalId', 'topicInternalId'],
|
||||
'lengths' => [],
|
||||
'orders' => [],
|
||||
],
|
||||
[
|
||||
'$id' => ID::custom('_fulltext_search'),
|
||||
'type' => Database::INDEX_FULLTEXT,
|
||||
|
|
|
@ -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
|
||||
$failure = $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, $failure['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'],
|
||||
|
|
Loading…
Reference in a new issue