1
0
Fork 0
mirror of synced 2024-06-18 18:54:55 +12:00

Fixed tests

This commit is contained in:
Eldad Fux 2021-08-01 13:15:06 +03:00
parent 0685fec3a1
commit 8d11f16e12

View file

@ -545,13 +545,15 @@ class ProjectsConsoleClientTest extends Scope
if(!$service['optional']) {
continue;
}
$key = $service['key'] ?? '';
$response = $this->client->call(Client::METHOD_PATCH, '/projects/'.$id.'/service', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'cookie' => 'a_session_console=' . $this->getRoot()['session'],
]), [
'service' => $service,
'service' => $key,
'status' => false,
]);
@ -566,7 +568,7 @@ class ProjectsConsoleClientTest extends Scope
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertNotEmpty($response['body']['$id']);
$this->assertEquals(false, $response['body']['serviceStatusFor'.ucfirst($service)]);
$this->assertEquals(false, $response['body']['serviceStatusFor'.ucfirst($key)]);
}
/**
@ -585,11 +587,17 @@ class ProjectsConsoleClientTest extends Scope
$this->assertEquals(200, $response['headers']['status-code']);
foreach ($services as $service) {
if(!$service['optional']) {
continue;
}
$key = $service['key'] ?? '';
$response = $this->client->call(Client::METHOD_PATCH, '/projects/'.$id.'/service/', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'service' => $service,
'service' => $key,
'status' => true,
]);
}
@ -602,18 +610,24 @@ class ProjectsConsoleClientTest extends Scope
{
$id = $data['projectId'];
$services = ['functions', 'webhooks', 'avatars', 'health', 'locale', 'storage', 'teams'];
$services = require('app/config/services.php');
/**
* Test for Disabled
*/
foreach ($services as $service) {
if(!$service['optional']) {
continue;
}
$key = $service['key'] ?? '';
$response = $this->client->call(Client::METHOD_PATCH, '/projects/'.$id.'/service', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'cookie' => 'a_session_console=' . $this->getRoot()['session'],
]), [
'service' => $service,
'service' => $key,
'status' => false,
]);
@ -628,7 +642,7 @@ class ProjectsConsoleClientTest extends Scope
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertNotEmpty($response['body']['$id']);
$this->assertEquals(false, $response['body']['serviceStatusFor'.ucfirst($service)]);
$this->assertEquals(false, $response['body']['serviceStatusFor'.ucfirst($key)]);
}
/**