2020-01-13 04:20:51 +13:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\E2E\Services\Health;
|
|
|
|
|
2020-05-01 22:43:31 +12:00
|
|
|
use Tests\E2E\Client;
|
2020-01-13 04:20:51 +13:00
|
|
|
use Tests\E2E\Scopes\Scope;
|
|
|
|
use Tests\E2E\Scopes\ProjectCustom;
|
|
|
|
use Tests\E2E\Scopes\SideClient;
|
2020-06-07 18:00:14 +12:00
|
|
|
use Tests\E2E\Scopes\SideServer;
|
2020-01-13 04:20:51 +13:00
|
|
|
|
2020-12-27 01:10:14 +13:00
|
|
|
class HealthCustomServerTest extends Scope
|
2020-01-13 04:20:51 +13:00
|
|
|
{
|
|
|
|
use HealthBase;
|
|
|
|
use ProjectCustom;
|
2020-06-07 18:00:14 +12:00
|
|
|
use SideServer;
|
2020-05-01 22:43:31 +12:00
|
|
|
|
2021-10-27 02:19:28 +13:00
|
|
|
public function testHTTPSuccess(): array
|
2020-05-01 22:43:31 +12:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Test for SUCCESS
|
|
|
|
*/
|
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health', array_merge([
|
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
2021-12-17 01:19:04 +13:00
|
|
|
$this->assertEquals('pass', $response['body']['status']);
|
|
|
|
$this->assertIsInt($response['body']['ping']);
|
|
|
|
$this->assertLessThan(100, $response['body']['ping']);
|
2020-05-01 22:43:31 +12:00
|
|
|
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
2021-10-27 02:19:28 +13:00
|
|
|
public function testDBSuccess(): array
|
2020-05-01 22:43:31 +12:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Test for SUCCESS
|
|
|
|
*/
|
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/db', array_merge([
|
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
2022-10-18 00:43:57 +13:00
|
|
|
$this->assertEquals('pass', $response['body']['statuses'][0]['status']);
|
|
|
|
$this->assertIsInt($response['body']['statuses'][0]['ping']);
|
|
|
|
$this->assertLessThan(100, $response['body']['statuses'][0]['ping']);
|
2020-05-01 22:43:31 +12:00
|
|
|
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
2021-10-27 02:19:28 +13:00
|
|
|
public function testCacheSuccess(): array
|
2020-05-01 22:43:31 +12:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Test for SUCCESS
|
|
|
|
*/
|
2020-12-27 04:10:45 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/cache', array_merge([
|
2020-05-01 22:43:31 +12:00
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
2022-10-18 00:43:57 +13:00
|
|
|
$this->assertEquals('pass', $response['body']['statuses'][0]['status']);
|
|
|
|
$this->assertIsInt($response['body']['statuses'][0]['ping']);
|
|
|
|
$this->assertLessThan(100, $response['body']['statuses'][0]['ping']);
|
|
|
|
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testQueueSuccess(): array
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Test for SUCCESS
|
|
|
|
*/
|
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue', array_merge([
|
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
|
|
|
$this->assertEquals('pass', $response['body']['statuses'][0]['status']);
|
|
|
|
$this->assertIsInt($response['body']['statuses'][0]['ping']);
|
|
|
|
$this->assertLessThan(100, $response['body']['statuses'][0]['ping']);
|
|
|
|
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testPubSubSuccess(): array
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Test for SUCCESS
|
|
|
|
*/
|
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/pubsub', array_merge([
|
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
|
|
|
$this->assertEquals('pass', $response['body']['statuses'][0]['status']);
|
|
|
|
$this->assertIsInt($response['body']['statuses'][0]['ping']);
|
|
|
|
$this->assertLessThan(100, $response['body']['statuses'][0]['ping']);
|
2020-05-01 22:43:31 +12:00
|
|
|
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
2021-10-27 02:19:28 +13:00
|
|
|
public function testTimeSuccess(): array
|
2020-05-01 22:43:31 +12:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Test for SUCCESS
|
|
|
|
*/
|
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/time', array_merge([
|
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
2021-12-17 01:19:04 +13:00
|
|
|
$this->assertIsInt($response['body']['remoteTime']);
|
|
|
|
$this->assertIsInt($response['body']['localTime']);
|
|
|
|
$this->assertNotEmpty($response['body']['remoteTime']);
|
|
|
|
$this->assertNotEmpty($response['body']['localTime']);
|
2020-05-01 22:43:31 +12:00
|
|
|
$this->assertLessThan(10, $response['body']['diff']);
|
|
|
|
|
2023-10-16 06:41:09 +13:00
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testWebhooksSuccess(): array
|
|
|
|
{
|
2020-05-01 22:43:31 +12:00
|
|
|
/**
|
2023-10-16 06:41:09 +13:00
|
|
|
* Test for SUCCESS
|
2020-05-01 22:43:31 +12:00
|
|
|
*/
|
2023-10-16 06:41:09 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/webhooks', array_merge([
|
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
|
|
|
$this->assertIsInt($response['body']['size']);
|
|
|
|
$this->assertLessThan(100, $response['body']['size']);
|
2020-05-01 22:43:31 +12:00
|
|
|
|
2023-11-14 02:07:11 +13:00
|
|
|
/**
|
|
|
|
* Test for FAILURE
|
|
|
|
*/
|
2023-11-14 02:39:33 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/webhooks?threshold=0', array_merge([
|
2023-11-14 02:07:11 +13:00
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
2023-11-17 07:49:43 +13:00
|
|
|
$this->assertEquals(503, $response['headers']['status-code']);
|
2023-11-14 02:07:11 +13:00
|
|
|
|
2023-10-03 21:40:34 +13:00
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
2023-10-16 06:41:09 +13:00
|
|
|
public function testLogsSuccess(): array
|
2023-10-03 21:40:34 +13:00
|
|
|
{
|
2020-05-01 22:43:31 +12:00
|
|
|
/**
|
2023-10-03 21:40:34 +13:00
|
|
|
* Test for SUCCESS
|
2020-05-01 22:43:31 +12:00
|
|
|
*/
|
2023-10-16 06:41:09 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/logs', array_merge([
|
2023-10-03 21:40:34 +13:00
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
|
|
|
$this->assertIsInt($response['body']['size']);
|
|
|
|
$this->assertLessThan(100, $response['body']['size']);
|
2021-10-27 02:19:28 +13:00
|
|
|
|
2023-11-14 02:07:11 +13:00
|
|
|
/**
|
|
|
|
* Test for FAILURE
|
|
|
|
*/
|
2023-11-14 02:39:33 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/logs?threshold=0', array_merge([
|
2023-11-14 02:07:11 +13:00
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
2023-11-17 07:49:43 +13:00
|
|
|
$this->assertEquals(503, $response['headers']['status-code']);
|
2023-11-14 02:07:11 +13:00
|
|
|
|
2023-10-16 06:41:09 +13:00
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testCertificatesSuccess(): array
|
|
|
|
{
|
2020-05-01 22:43:31 +12:00
|
|
|
/**
|
2023-10-16 06:41:09 +13:00
|
|
|
* Test for SUCCESS
|
2020-05-01 22:43:31 +12:00
|
|
|
*/
|
2023-10-16 06:41:09 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/certificates', array_merge([
|
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
|
|
|
$this->assertIsInt($response['body']['size']);
|
|
|
|
$this->assertLessThan(100, $response['body']['size']);
|
2020-05-01 22:43:31 +12:00
|
|
|
|
2023-11-14 02:07:11 +13:00
|
|
|
/**
|
|
|
|
* Test for FAILURE
|
|
|
|
*/
|
2023-11-14 02:39:33 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/certificates?threshold=0', array_merge([
|
2023-11-14 02:07:11 +13:00
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
2023-11-17 07:49:43 +13:00
|
|
|
$this->assertEquals(503, $response['headers']['status-code']);
|
2023-11-14 02:07:11 +13:00
|
|
|
|
2023-10-03 21:40:34 +13:00
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
2023-10-16 06:41:09 +13:00
|
|
|
public function testFunctionsSuccess(): array
|
2023-10-03 21:40:34 +13:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Test for SUCCESS
|
|
|
|
*/
|
2023-10-16 06:41:09 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/functions', array_merge([
|
2023-10-03 21:40:34 +13:00
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
|
|
|
$this->assertIsInt($response['body']['size']);
|
|
|
|
$this->assertLessThan(100, $response['body']['size']);
|
|
|
|
|
2023-11-14 02:07:11 +13:00
|
|
|
/**
|
|
|
|
* Test for FAILURE
|
|
|
|
*/
|
2023-11-14 02:39:33 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/functions?threshold=0', array_merge([
|
2023-11-14 02:07:11 +13:00
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
2023-11-17 07:49:43 +13:00
|
|
|
$this->assertEquals(503, $response['headers']['status-code']);
|
2023-11-14 02:07:11 +13:00
|
|
|
|
2023-10-16 06:41:09 +13:00
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testBuildsSuccess(): array
|
|
|
|
{
|
2020-05-01 22:43:31 +12:00
|
|
|
/**
|
2023-10-16 06:41:09 +13:00
|
|
|
* Test for SUCCESS
|
2020-05-01 22:43:31 +12:00
|
|
|
*/
|
2023-10-16 06:41:09 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/builds', array_merge([
|
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
|
|
|
$this->assertIsInt($response['body']['size']);
|
|
|
|
$this->assertLessThan(100, $response['body']['size']);
|
2023-10-03 21:40:34 +13:00
|
|
|
|
2023-11-14 02:07:11 +13:00
|
|
|
/**
|
|
|
|
* Test for FAILURE
|
|
|
|
*/
|
2023-11-14 02:39:33 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/builds?threshold=0', array_merge([
|
2023-11-14 02:07:11 +13:00
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
2023-11-17 07:49:43 +13:00
|
|
|
$this->assertEquals(503, $response['headers']['status-code']);
|
2023-11-14 02:07:11 +13:00
|
|
|
|
2023-10-03 21:40:34 +13:00
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
2023-10-16 06:41:09 +13:00
|
|
|
public function testDatabasesSuccess(): array
|
2023-10-03 21:40:34 +13:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Test for SUCCESS
|
|
|
|
*/
|
2023-10-19 13:09:32 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/databases', array_merge([
|
2023-10-03 21:40:34 +13:00
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
2023-10-19 13:09:32 +13:00
|
|
|
], $this->getHeaders()), [
|
2023-10-19 22:25:38 +13:00
|
|
|
'name' => 'database_db_main',
|
2023-10-19 13:09:32 +13:00
|
|
|
]);
|
2023-10-03 21:40:34 +13:00
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
|
|
|
$this->assertIsInt($response['body']['size']);
|
|
|
|
$this->assertLessThan(100, $response['body']['size']);
|
|
|
|
|
2023-11-14 02:07:11 +13:00
|
|
|
/**
|
|
|
|
* Test for FAILURE
|
|
|
|
*/
|
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/databases', array_merge([
|
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), [
|
|
|
|
'name' => 'database_db_main',
|
2023-11-14 02:39:33 +13:00
|
|
|
'threshold' => '0'
|
2023-11-14 02:07:11 +13:00
|
|
|
]);
|
2023-11-17 07:49:43 +13:00
|
|
|
$this->assertEquals(503, $response['headers']['status-code']);
|
2023-11-14 02:07:11 +13:00
|
|
|
|
2023-10-16 06:41:09 +13:00
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testDeletesSuccess(): array
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Test for SUCCESS
|
|
|
|
*/
|
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/deletes', array_merge([
|
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
|
|
|
$this->assertIsInt($response['body']['size']);
|
|
|
|
$this->assertLessThan(100, $response['body']['size']);
|
|
|
|
|
2023-11-14 02:07:11 +13:00
|
|
|
/**
|
|
|
|
* Test for FAILURE
|
|
|
|
*/
|
2023-11-14 02:39:33 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/deletes?threshold=0', array_merge([
|
2023-11-14 02:07:11 +13:00
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
2023-11-17 07:49:43 +13:00
|
|
|
$this->assertEquals(503, $response['headers']['status-code']);
|
2023-11-14 02:07:11 +13:00
|
|
|
|
2023-10-16 06:41:09 +13:00
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testMailsSuccess(): array
|
|
|
|
{
|
2023-10-03 21:40:34 +13:00
|
|
|
/**
|
2023-10-16 06:41:09 +13:00
|
|
|
* Test for SUCCESS
|
2023-10-03 21:40:34 +13:00
|
|
|
*/
|
2023-10-16 06:41:09 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/mails', array_merge([
|
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
|
|
|
$this->assertIsInt($response['body']['size']);
|
|
|
|
$this->assertLessThan(100, $response['body']['size']);
|
|
|
|
|
2023-11-14 02:07:11 +13:00
|
|
|
/**
|
|
|
|
* Test for FAILURE
|
|
|
|
*/
|
2023-11-14 02:39:33 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/mails?threshold=0', array_merge([
|
2023-11-14 02:07:11 +13:00
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
2023-11-17 07:49:43 +13:00
|
|
|
$this->assertEquals(503, $response['headers']['status-code']);
|
2023-11-14 02:07:11 +13:00
|
|
|
|
2023-10-16 06:41:09 +13:00
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testMessagingSuccess(): array
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Test for SUCCESS
|
|
|
|
*/
|
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/messaging', array_merge([
|
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
|
|
|
$this->assertIsInt($response['body']['size']);
|
|
|
|
$this->assertLessThan(100, $response['body']['size']);
|
|
|
|
|
2023-11-14 02:07:11 +13:00
|
|
|
/**
|
|
|
|
* Test for FAILURE
|
|
|
|
*/
|
2023-11-14 02:39:33 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/messaging?threshold=0', array_merge([
|
2023-11-14 02:07:11 +13:00
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
2023-11-17 07:49:43 +13:00
|
|
|
$this->assertEquals(503, $response['headers']['status-code']);
|
2023-11-14 02:07:11 +13:00
|
|
|
|
2023-10-16 06:41:09 +13:00
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testMigrationsSuccess(): array
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Test for SUCCESS
|
|
|
|
*/
|
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/migrations', array_merge([
|
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
|
|
|
$this->assertIsInt($response['body']['size']);
|
|
|
|
$this->assertLessThan(100, $response['body']['size']);
|
2021-10-27 02:19:28 +13:00
|
|
|
|
2023-11-14 02:07:11 +13:00
|
|
|
/**
|
|
|
|
* Test for FAILURE
|
|
|
|
*/
|
2023-11-14 02:39:33 +13:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/queue/migrations?threshold=0', array_merge([
|
2023-11-14 02:07:11 +13:00
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
2023-11-17 07:49:43 +13:00
|
|
|
$this->assertEquals(503, $response['headers']['status-code']);
|
2023-11-14 02:07:11 +13:00
|
|
|
|
2020-05-01 22:43:31 +12:00
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
2021-10-27 02:19:28 +13:00
|
|
|
public function testStorageLocalSuccess(): array
|
2020-05-01 22:43:31 +12:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Test for SUCCESS
|
|
|
|
*/
|
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/storage/local', array_merge([
|
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
2021-12-17 01:19:04 +13:00
|
|
|
$this->assertEquals('pass', $response['body']['status']);
|
|
|
|
$this->assertIsInt($response['body']['ping']);
|
|
|
|
$this->assertLessThan(100, $response['body']['ping']);
|
2020-05-01 22:43:31 +12:00
|
|
|
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
2021-10-27 02:19:28 +13:00
|
|
|
public function testStorageAntiVirusSuccess(): array
|
2020-05-01 22:43:31 +12:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Test for SUCCESS
|
|
|
|
*/
|
2020-05-19 00:34:28 +12:00
|
|
|
$response = $this->client->call(Client::METHOD_GET, '/health/anti-virus', array_merge([
|
2020-05-01 22:43:31 +12:00
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
], $this->getHeaders()), []);
|
|
|
|
|
|
|
|
$this->assertEquals(200, $response['headers']['status-code']);
|
2021-03-20 21:50:30 +13:00
|
|
|
$this->assertNotEmpty($response['body']['status']);
|
|
|
|
$this->assertIsString($response['body']['status']);
|
|
|
|
$this->assertIsString($response['body']['version']);
|
2020-05-01 22:43:31 +12:00
|
|
|
|
|
|
|
return [];
|
|
|
|
}
|
2021-10-27 02:19:28 +13:00
|
|
|
}
|