Add graph QL alias test

This commit is contained in:
Matej Bačo
2023-10-02 11:52:29 +02:00
parent 0cd6e0d89f
commit 7bb94ce2e2
2 changed files with 19 additions and 0 deletions
+18
View File
@@ -136,6 +136,24 @@ class HealthTest extends Scope
$logsQueueHealth = $logsQueueHealth['body']['data']['healthGetQueueLogs'];
$this->assertIsArray($logsQueueHealth);
// 1.x alias test
$graphQLPayload = [
'query' => 'query getLogsQueueHealth {
healthGetQueueLogs {
size
}
}'
];
$logsQueueHealth = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
$this->assertIsArray($logsQueueHealth['body']['data']);
$this->assertArrayNotHasKey('errors', $logsQueueHealth['body']);
$logsQueueHealth = $logsQueueHealth['body']['data']['healthGetQueueLogs'];
$this->assertIsArray($logsQueueHealth);
return $logsQueueHealth;
}
@@ -155,6 +155,7 @@ class HealthCustomServerTest extends Scope
$this->assertIsInt($response['body']['size']);
$this->assertLessThan(100, $response['body']['size']);
// 1.x alias test
$response = $this->client->call(Client::METHOD_GET, '/health/queue/logs', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],