1
0
Fork 0
mirror of synced 2024-09-29 17:01:37 +13:00

Update tests

This commit is contained in:
Jake Barnby 2024-02-15 17:30:09 +13:00
parent afba7f75f0
commit 142e92b4b8
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
2 changed files with 27 additions and 5 deletions

View file

@ -2026,6 +2026,9 @@ trait Base
messagingCreateTopic(topicId: $topicId, name: $name) { messagingCreateTopic(topicId: $topicId, name: $name) {
_id _id
name name
emailTotal
smsTotal
pushTotal
} }
}'; }';
case self::$LIST_TOPICS: case self::$LIST_TOPICS:
@ -2035,6 +2038,9 @@ trait Base
topics { topics {
_id _id
name name
emailTotal
smsTotal
pushTotal
} }
} }
}'; }';
@ -2043,6 +2049,9 @@ trait Base
messagingGetTopic(topicId: $topicId) { messagingGetTopic(topicId: $topicId) {
_id _id
name name
emailTotal
smsTotal
pushTotal
} }
}'; }';
case self::$UPDATE_TOPIC: case self::$UPDATE_TOPIC:
@ -2050,6 +2059,9 @@ trait Base
messagingUpdateTopic(topicId: $topicId, name: $name) { messagingUpdateTopic(topicId: $topicId, name: $name) {
_id _id
name name
emailTotal
smsTotal
pushTotal
} }
}'; }';
case self::$DELETE_TOPIC: case self::$DELETE_TOPIC:

View file

@ -355,7 +355,9 @@ trait MessagingBase
'x-appwrite-key' => $this->getProject()['apiKey'], 'x-appwrite-key' => $this->getProject()['apiKey'],
], [ ], [
'queries' => [ 'queries' => [
Query::equal('total', [0])->toString(), Query::equal('emailTotal', [0])->toString(),
Query::equal('smsTotal', [0])->toString(),
Query::equal('pushTotal', [0])->toString(),
], ],
]); ]);
@ -368,7 +370,9 @@ trait MessagingBase
'x-appwrite-key' => $this->getProject()['apiKey'], 'x-appwrite-key' => $this->getProject()['apiKey'],
], [ ], [
'queries' => [ 'queries' => [
Query::greaterThan('total', 0)->toString(), Query::greaterThan('emailTotal', 0)->toString(),
Query::greaterThan('smsTotal', 0)->toString(),
Query::greaterThan('pushTotal', 0)->toString(),
], ],
]); ]);
@ -390,7 +394,9 @@ trait MessagingBase
]); ]);
$this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(200, $response['headers']['status-code']);
$this->assertEquals('android-app', $response['body']['name']); $this->assertEquals('android-app', $response['body']['name']);
$this->assertEquals(0, $response['body']['total']); $this->assertEquals(0, $response['body']['emailTotal']);
$this->assertEquals(0, $response['body']['smsTotal']);
$this->assertEquals(0, $response['body']['pushTotal']);
} }
/** /**
@ -446,7 +452,9 @@ trait MessagingBase
$this->assertEquals(200, $topic['headers']['status-code']); $this->assertEquals(200, $topic['headers']['status-code']);
$this->assertEquals('android-app', $topic['body']['name']); $this->assertEquals('android-app', $topic['body']['name']);
$this->assertEquals(1, $topic['body']['total']); $this->assertEquals(1, $topic['body']['emailTotal']);
$this->assertEquals(0, $topic['body']['smsTotal']);
$this->assertEquals(0, $topic['body']['pushTotal']);
$response2 = $this->client->call(Client::METHOD_POST, '/messaging/topics/' . $topics['private']['$id'] . '/subscribers', \array_merge([ $response2 = $this->client->call(Client::METHOD_POST, '/messaging/topics/' . $topics['private']['$id'] . '/subscribers', \array_merge([
'content-type' => 'application/json', 'content-type' => 'application/json',
@ -695,7 +703,9 @@ trait MessagingBase
$this->assertEquals(200, $topic['headers']['status-code']); $this->assertEquals(200, $topic['headers']['status-code']);
$this->assertEquals('android-app', $topic['body']['name']); $this->assertEquals('android-app', $topic['body']['name']);
$this->assertEquals(0, $topic['body']['total']); $this->assertEquals(0, $topic['body']['emailTotal']);
$this->assertEquals(0, $topic['body']['smsTotal']);
$this->assertEquals(0, $topic['body']['pushTotal']);
} }
/** /**