From a59fe0b701b28629f1e961b2bb8c2a939b430bc3 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 12 Jan 2023 18:38:21 +0000 Subject: [PATCH] fix tests --- app/config/roles.php | 6 +- app/config/services.php | 21 +- app/controllers/api/admin.php | 40 +-- app/controllers/api/project.php | 98 ++++--- .../Projects/ProjectsConsoleClientTest.php | 268 +++++++++--------- 5 files changed, 225 insertions(+), 208 deletions(-) diff --git a/app/config/roles.php b/app/config/roles.php index 80f8bbd459..362a649a11 100644 --- a/app/config/roles.php +++ b/app/config/roles.php @@ -13,8 +13,10 @@ $member = [ 'documents.write', 'files.read', 'files.write', - 'projects.read', - 'projects.write', + 'project.read', + 'project.write', + 'admin.read', + 'admin.write', 'locale.read', 'avatars.read', 'execution.read', diff --git a/app/config/services.php b/app/config/services.php index 7369574a80..18f795c99a 100644 --- a/app/config/services.php +++ b/app/config/services.php @@ -95,12 +95,25 @@ return [ 'optional' => true, 'icon' => '/images/services/health.png', ], - 'projects' => [ - 'key' => 'projects', - 'name' => 'Projects', + 'admin' => [ + 'key' => 'admin', + 'name' => 'admin', 'subtitle' => 'The Project service allows you to manage all the projects in your Appwrite server.', 'description' => '', - 'controller' => 'api/projects.php', + 'controller' => 'api/admin.php', + 'sdk' => true, + 'docs' => true, + 'docsUrl' => '', + 'tests' => false, + 'optional' => false, + 'icon' => '', + ], + 'project' => [ + 'key' => 'project', + 'name' => 'Project', + 'subtitle' => 'The Project service allows you to manage all the projects in your Appwrite server.', + 'description' => '', + 'controller' => 'api/project.php', 'sdk' => true, 'docs' => true, 'docsUrl' => '', diff --git a/app/controllers/api/admin.php b/app/controllers/api/admin.php index c4fd14792b..d47b8be6d3 100644 --- a/app/controllers/api/admin.php +++ b/app/controllers/api/admin.php @@ -28,7 +28,7 @@ use Utopia\Database\Validator\UID; use Utopia\Domains\Domain; use Utopia\Registry\Registry; use Appwrite\Extend\Exception; -use Appwrite\Utopia\Database\Validator\Queries\admin; +use Appwrite\Utopia\Database\Validator\Queries\Projects; use Utopia\Validator\ArrayList; use Utopia\Validator\Boolean; use Utopia\Validator\Hostname; @@ -38,16 +38,16 @@ use Utopia\Validator\Text; use Utopia\Validator\WhiteList; App::get('/v1/admin') - ->desc('List admin') + ->desc('List Projects') ->groups(['api', 'admin']) ->label('scope', 'admin.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) ->label('sdk.namespace', 'admin') - ->label('sdk.method', 'list') + ->label('sdk.method', 'listProjects') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_PROJECT_LIST) - ->param('queries', [], new admin(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', admin::ALLOWED_ATTRIBUTES), true) + ->param('queries', [], new Projects(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Projects::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') ->inject('dbForConsole') @@ -82,37 +82,7 @@ App::get('/v1/admin') ]), Response::MODEL_PROJECT_LIST); }); - App::get('/v1/admin/:projectId/webhooks') - ->desc('List Webhooks') - ->groups(['api', 'admin']) - ->label('scope', 'admin.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'admin') - ->label('sdk.method', 'listWebhooks') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_WEBHOOK_LIST) - ->param('projectId', '', new UID(), 'Project unique ID.') - ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, Response $response, Database $dbForConsole) { - - $project = $dbForConsole->getDocument('admin', $projectId); - - if ($project->isEmpty()) { - throw new Exception(Exception::PROJECT_NOT_FOUND); - } - - $webhooks = $dbForConsole->find('webhooks', [ - Query::equal('projectInternalId', [$project->getInternalId()]), - Query::limit(5000), - ]); - - $response->dynamic(new Document([ - 'webhooks' => $webhooks, - 'total' => count($webhooks), - ]), Response::MODEL_WEBHOOK_LIST); - }); + App::get('/v1/admin/:projectId/keys') ->desc('List Keys') diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index 1331958888..b974cc8a26 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -92,7 +92,7 @@ App::post('/v1/project') throw new Exception(Exception::PROJECT_RESERVED_PROJECT, "'console' is a reserved project."); } - $project = $dbForConsole->createDocument('project', new Document([ + $project = $dbForConsole->createDocument('projects', new Document([ '$id' => $projectId, '$permissions' => [ Permission::read(Role::team(ID::custom($teamId))), @@ -190,7 +190,7 @@ App::get('/v1/project/:projectId') ->inject('dbForConsole') ->action(function (string $projectId, Response $response, Database $dbForConsole) { - $project = $dbForConsole->getDocument('project', $projectId); + $project = $dbForConsole->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -217,7 +217,7 @@ App::get('/v1/project/:projectId/usage') ->inject('register') ->action(function (string $projectId, string $range, Response $response, Database $dbForConsole, Database $dbForProject, Registry $register) { - $project = $dbForConsole->getDocument('project', $projectId); + $project = $dbForConsole->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -338,13 +338,13 @@ App::patch('/v1/project/:projectId') ->inject('dbForConsole') ->action(function (string $projectId, string $name, string $description, string $logo, string $url, string $legalName, string $legalCountry, string $legalState, string $legalCity, string $legalAddress, string $legalTaxId, Response $response, Database $dbForConsole) { - $project = $dbForConsole->getDocument('project', $projectId); + $project = $dbForConsole->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $project = $dbForConsole->updateDocument('project', $project->getId(), $project + $project = $dbForConsole->updateDocument('projects', $project->getId(), $project ->setAttribute('name', $name) ->setAttribute('description', $description) ->setAttribute('logo', $logo) @@ -360,6 +360,38 @@ App::patch('/v1/project/:projectId') $response->dynamic($project, Response::MODEL_PROJECT); }); +App::get('/v1/admin/:projectId/webhooks') + ->desc('List Webhooks') + ->groups(['api', 'admin']) + ->label('scope', 'admin.read') + ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) + ->label('sdk.namespace', 'admin') + ->label('sdk.method', 'listWebhooks') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_WEBHOOK_LIST) + ->param('projectId', '', new UID(), 'Project unique ID.') + ->inject('response') + ->inject('dbForConsole') + ->action(function (string $projectId, Response $response, Database $dbForConsole) { + + $project = $dbForConsole->getDocument('projects', $projectId); + + if ($project->isEmpty()) { + throw new Exception(Exception::PROJECT_NOT_FOUND); + } + + $webhooks = $dbForConsole->find('webhooks', [ + Query::equal('projectInternalId', [$project->getInternalId()]), + Query::limit(5000), + ]); + + $response->dynamic(new Document([ + 'webhooks' => $webhooks, + 'total' => count($webhooks), + ]), Response::MODEL_WEBHOOK_LIST); + }); + App::patch('/v1/project/:projectId/service') ->desc('Update service status') ->groups(['api', 'project']) @@ -377,7 +409,7 @@ App::patch('/v1/project/:projectId/service') ->inject('dbForConsole') ->action(function (string $projectId, string $service, bool $status, Response $response, Database $dbForConsole) { - $project = $dbForConsole->getDocument('project', $projectId); + $project = $dbForConsole->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -386,7 +418,7 @@ App::patch('/v1/project/:projectId/service') $services = $project->getAttribute('services', []); $services[$service] = $status; - $project = $dbForConsole->updateDocument('project', $project->getId(), $project->setAttribute('services', $services)); + $project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('services', $services)); $response->dynamic($project, Response::MODEL_PROJECT); }); @@ -410,7 +442,7 @@ App::patch('/v1/project/:projectId/oauth2') ->inject('dbForConsole') ->action(function (string $projectId, string $provider, ?string $appId, ?string $secret, ?bool $enabled, Response $response, Database $dbForConsole) { - $project = $dbForConsole->getDocument('project', $projectId); + $project = $dbForConsole->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -430,7 +462,7 @@ App::patch('/v1/project/:projectId/oauth2') $providers[$provider . 'Enabled'] = $enabled; } - $project = $dbForConsole->updateDocument('project', $project->getId(), $project->setAttribute('authProviders', $providers)); + $project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('authProviders', $providers)); $response->dynamic($project, Response::MODEL_PROJECT); }); @@ -451,7 +483,7 @@ App::patch('/v1/project/:projectId/oauth2') ->inject('dbForConsole') ->action(function (string $projectId, int $limit, Response $response, Database $dbForConsole) { - $project = $dbForConsole->getDocument('project', $projectId); + $project = $dbForConsole->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -460,7 +492,7 @@ App::patch('/v1/project/:projectId/oauth2') $auths = $project->getAttribute('auths', []); $auths['limit'] = $limit; - $dbForConsole->updateDocument('project', $project->getId(), $project + $dbForConsole->updateDocument('projects', $project->getId(), $project ->setAttribute('auths', $auths)); $response->dynamic($project, Response::MODEL_PROJECT); @@ -482,7 +514,7 @@ App::patch('/v1/project/:projectId/oauth2') ->inject('dbForConsole') ->action(function (string $projectId, int $duration, Response $response, Database $dbForConsole) { - $project = $dbForConsole->getDocument('project', $projectId); + $project = $dbForConsole->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -491,7 +523,7 @@ App::patch('/v1/project/:projectId/oauth2') $auths = $project->getAttribute('auths', []); $auths['duration'] = $duration; - $dbForConsole->updateDocument('project', $project->getId(), $project + $dbForConsole->updateDocument('projects', $project->getId(), $project ->setAttribute('auths', $auths)); $response->dynamic($project, Response::MODEL_PROJECT); @@ -514,7 +546,7 @@ App::patch('/v1/project/:projectId/oauth2') ->inject('dbForConsole') ->action(function (string $projectId, string $method, bool $status, Response $response, Database $dbForConsole) { - $project = $dbForConsole->getDocument('project', $projectId); + $project = $dbForConsole->getDocument('projects', $projectId); $auth = Config::getParam('auth')[$method] ?? []; $authKey = $auth['key'] ?? ''; $status = ($status === '1' || $status === 'true' || $status === 1 || $status === true); @@ -526,7 +558,7 @@ App::patch('/v1/project/:projectId/oauth2') $auths = $project->getAttribute('auths', []); $auths[$authKey] = $status; - $project = $dbForConsole->updateDocument('project', $project->getId(), $project->setAttribute('auths', $auths)); + $project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('auths', $auths)); $response->dynamic($project, Response::MODEL_PROJECT); }); @@ -563,7 +595,7 @@ App::patch('/v1/project/:projectId/oauth2') ->setDocument($project) ; - if (!$dbForConsole->deleteDocument('project', $projectId)) { + if (!$dbForConsole->deleteDocument('projects', $projectId)) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove project from DB'); } @@ -593,7 +625,7 @@ App::patch('/v1/project/:projectId/oauth2') ->inject('dbForConsole') ->action(function (string $projectId, string $name, array $events, string $url, bool $security, string $httpUser, string $httpPass, Response $response, Database $dbForConsole) { - $project = $dbForConsole->getDocument('project', $projectId); + $project = $dbForConsole->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -621,7 +653,7 @@ App::patch('/v1/project/:projectId/oauth2') $webhook = $dbForConsole->createDocument('webhooks', $webhook); - $dbForConsole->deleteCachedDocument('project', $project->getId()); + $dbForConsole->deleteCachedDocument('projects', $project->getId()); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -644,7 +676,7 @@ App::patch('/v1/project/:projectId/oauth2') ->inject('dbForConsole') ->action(function (string $projectId, string $webhookId, Response $response, Database $dbForConsole) { - $project = $dbForConsole->getDocument('project', $projectId); + $project = $dbForConsole->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -684,7 +716,7 @@ App::patch('/v1/project/:projectId/oauth2') ->inject('dbForConsole') ->action(function (string $projectId, string $webhookId, string $name, array $events, string $url, bool $security, string $httpUser, string $httpPass, Response $response, Database $dbForConsole) { - $project = $dbForConsole->getDocument('project', $projectId); + $project = $dbForConsole->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -711,7 +743,7 @@ App::patch('/v1/project/:projectId/oauth2') ; $dbForConsole->updateDocument('webhooks', $webhook->getId(), $webhook); - $dbForConsole->deleteCachedDocument('project', $project->getId()); + $dbForConsole->deleteCachedDocument('projects', $project->getId()); $response->dynamic($webhook, Response::MODEL_WEBHOOK); }); @@ -750,7 +782,7 @@ App::patch('/v1/project/:projectId/oauth2') $webhook->setAttribute('signatureKey', \bin2hex(\random_bytes(64))); $dbForConsole->updateDocument('webhooks', $webhook->getId(), $webhook); - $dbForConsole->deleteCachedDocument('project', $project->getId()); + $dbForConsole->deleteCachedDocument('projects', $project->getId()); $response->dynamic($webhook, Response::MODEL_WEBHOOK); }); @@ -787,7 +819,7 @@ App::patch('/v1/project/:projectId/oauth2') $dbForConsole->deleteDocument('webhooks', $webhook->getId()); - $dbForConsole->deleteCachedDocument('project', $project->getId()); + $dbForConsole->deleteCachedDocument('projects', $project->getId()); $response->noContent(); }); @@ -812,7 +844,7 @@ App::patch('/v1/project/:projectId/oauth2') ->inject('dbForConsole') ->action(function (string $projectId, string $name, array $scopes, ?string $expire, Response $response, Database $dbForConsole) { - $project = $dbForConsole->getDocument('project', $projectId); + $project = $dbForConsole->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -837,7 +869,7 @@ App::patch('/v1/project/:projectId/oauth2') $key = $dbForConsole->createDocument('keys', $key); - $dbForConsole->deleteCachedDocument('project', $project->getId()); + $dbForConsole->deleteCachedDocument('projects', $project->getId()); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -920,7 +952,7 @@ App::patch('/v1/project/:projectId/oauth2') $dbForConsole->updateDocument('keys', $key->getId(), $key); - $dbForConsole->deleteCachedDocument('project', $project->getId()); + $dbForConsole->deleteCachedDocument('projects', $project->getId()); $response->dynamic($key, Response::MODEL_KEY); }); @@ -957,7 +989,7 @@ App::patch('/v1/project/:projectId/oauth2') $dbForConsole->deleteDocument('keys', $key->getId()); - $dbForConsole->deleteCachedDocument('project', $project->getId()); + $dbForConsole->deleteCachedDocument('projects', $project->getId()); $response->noContent(); }); @@ -1007,7 +1039,7 @@ App::patch('/v1/project/:projectId/oauth2') $platform = $dbForConsole->createDocument('platforms', $platform); - $dbForConsole->deleteCachedDocument('project', $project->getId()); + $dbForConsole->deleteCachedDocument('projects', $project->getId()); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -1091,7 +1123,7 @@ App::patch('/v1/project/:projectId/oauth2') $dbForConsole->updateDocument('platforms', $platform->getId(), $platform); - $dbForConsole->deleteCachedDocument('project', $project->getId()); + $dbForConsole->deleteCachedDocument('projects', $project->getId()); $response->dynamic($platform, Response::MODEL_PLATFORM); }); @@ -1128,7 +1160,7 @@ App::patch('/v1/project/:projectId/oauth2') $dbForConsole->deleteDocument('platforms', $platformId); - $dbForConsole->deleteCachedDocument('project', $project->getId()); + $dbForConsole->deleteCachedDocument('projects', $project->getId()); $response->noContent(); }); @@ -1193,7 +1225,7 @@ App::patch('/v1/project/:projectId/oauth2') $domain = $dbForConsole->createDocument('domains', $domain); - $dbForConsole->deleteCachedDocument('project', $project->getId()); + $dbForConsole->deleteCachedDocument('projects', $project->getId()); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -1285,7 +1317,7 @@ App::patch('/v1/project/:projectId/oauth2') $dbForConsole->updateDocument('domains', $domain->getId(), $domain->setAttribute('verification', true)); - $dbForConsole->deleteCachedDocument('project', $project->getId()); + $dbForConsole->deleteCachedDocument('projects', $project->getId()); // Issue a TLS certificate when domain is verified $event = new Certificate(); @@ -1329,7 +1361,7 @@ App::patch('/v1/project/:projectId/oauth2') $dbForConsole->deleteDocument('domains', $domain->getId()); - $dbForConsole->deleteCachedDocument('project', $project->getId()); + $dbForConsole->deleteCachedDocument('projects', $project->getId()); $deletes ->setType(DELETE_TYPE_CERTIFICATES) diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 413b665897..12e346fe37 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -35,7 +35,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals('Project Test', $team['body']['name']); $this->assertNotEmpty($team['body']['$id']); - $response = $this->client->call(Client::METHOD_POST, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -55,7 +55,7 @@ class ProjectsConsoleClientTest extends Scope $projectId = $response['body']['$id']; - $response = $this->client->call(Client::METHOD_POST, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -75,7 +75,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_POST, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -87,7 +87,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(400, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_POST, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -112,7 +112,7 @@ class ProjectsConsoleClientTest extends Scope * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/admin', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -125,7 +125,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test search queries */ - $response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/admin', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders(), [ @@ -138,7 +138,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertCount(2, $response['body']['projects']); $this->assertEquals($response['body']['projects'][0]['name'], 'Project Test'); - $response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/admin', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders(), [ @@ -166,7 +166,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals('Project Test 2', $team['body']['name']); $this->assertNotEmpty($team['body']['$id']); - $response = $this->client->call(Client::METHOD_POST, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/admin', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -184,7 +184,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertArrayHasKey('webhooks', $response['body']); $this->assertArrayHasKey('keys', $response['body']); - $response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/admin', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -196,7 +196,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertCount(1, $response['body']['projects']); $this->assertEquals($team['body']['$id'], $response['body']['projects'][0]['teamId']); - $response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/admin', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -208,7 +208,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertCount(1, $response['body']['projects']); $this->assertEquals('Project Test', $response['body']['projects'][0]['name']); - $response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/admin', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -220,7 +220,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertCount(1, $response['body']['projects']); $this->assertEquals('Project Test 2', $response['body']['projects'][0]['name']); - $response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/admin', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -232,7 +232,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertCount(1, $response['body']['projects']); $this->assertEquals('Project Test 2', $response['body']['projects'][0]['name']); - $response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/admin', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -245,7 +245,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals('Project Test 2', $response['body']['projects'][0]['name']); $this->assertEquals('Project Test', $response['body']['projects'][1]['name']); - $response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/admin', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -256,7 +256,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals('Project Test', $response['body']['projects'][0]['name']); $this->assertEquals('Project Test 2', $response['body']['projects'][2]['name']); - $response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/admin', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -268,7 +268,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertCount(2, $response['body']['projects']); $this->assertEquals('Project Test 2', $response['body']['projects'][1]['name']); - $response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/admin', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -283,7 +283,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_GET, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/admin', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -305,7 +305,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -319,14 +319,14 @@ class ProjectsConsoleClientTest extends Scope * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_GET, '/projects/empty', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/empty', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); $this->assertEquals(404, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_GET, '/projects/id-is-really-long-id-is-really-long-id-is-really-long-id-is-really-long', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/id-is-really-long-id-is-really-long-id-is-really-long-id-is-really-long', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -346,7 +346,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/usage', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/usage', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -368,14 +368,14 @@ class ProjectsConsoleClientTest extends Scope * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_GET, '/projects/empty', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/empty', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); $this->assertEquals(404, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_GET, '/projects/id-is-really-long-id-is-really-long-id-is-really-long-id-is-really-long', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/id-is-really-long-id-is-really-long-id-is-really-long-id-is-really-long', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -395,7 +395,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id, array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -416,7 +416,7 @@ class ProjectsConsoleClientTest extends Scope * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_POST, '/projects', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -435,7 +435,7 @@ class ProjectsConsoleClientTest extends Scope $id = $data['projectId']; // Check defaults - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => 'console', ], $this->getHeaders())); @@ -447,7 +447,7 @@ class ProjectsConsoleClientTest extends Scope * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/auth/duration', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/auth/duration', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -527,7 +527,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(401, $response['headers']['status-code']); // Return project back to normal - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/auth/duration', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/auth/duration', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -538,7 +538,7 @@ class ProjectsConsoleClientTest extends Scope $projectId = $response['body']['$id']; // Check project is back to normal - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $projectId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $projectId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => 'console', ], $this->getHeaders())); @@ -562,7 +562,7 @@ class ProjectsConsoleClientTest extends Scope */ foreach ($providers as $key => $provider) { - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/oauth2', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/oauth2', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -575,7 +575,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertNotEmpty($response['body']['$id']); } - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -602,7 +602,7 @@ class ProjectsConsoleClientTest extends Scope // Enable providers $i = 0; foreach ($providers as $key => $provider) { - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/oauth2', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/oauth2', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -616,7 +616,7 @@ class ProjectsConsoleClientTest extends Scope $i++; } - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -646,7 +646,7 @@ class ProjectsConsoleClientTest extends Scope * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/oauth2', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/oauth2', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -698,7 +698,7 @@ class ProjectsConsoleClientTest extends Scope * Test for SUCCESS */ foreach ($auth as $index => $method) { - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/auth/' . $index, array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/auth/' . $index, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -708,7 +708,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -794,7 +794,7 @@ class ProjectsConsoleClientTest extends Scope // Cleanup foreach ($auth as $index => $method) { - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/auth/' . $index, array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/auth/' . $index, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -815,7 +815,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/auth/limit', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/auth/limit', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -848,7 +848,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/auth/limit', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/auth/limit', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -887,7 +887,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(201, $team['headers']['status-code']); $this->assertNotEmpty($team['body']['$id']); - $project = $this->client->call(Client::METHOD_POST, '/projects', array_merge([ + $project = $this->client->call(Client::METHOD_POST, '/project', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'cookie' => 'a_session_console=' . $this->getRoot()['session'], @@ -914,7 +914,7 @@ class ProjectsConsoleClientTest extends Scope $key = $service['key'] ?? ''; - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/service', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/service', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'cookie' => 'a_session_console=' . $this->getRoot()['session'], @@ -926,7 +926,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'cookie' => 'a_session_console=' . $this->getRoot()['session'], @@ -959,7 +959,7 @@ class ProjectsConsoleClientTest extends Scope $key = $service['key'] ?? ''; - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/service/', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/service/', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -988,7 +988,7 @@ class ProjectsConsoleClientTest extends Scope $key = $service['key'] ?? ''; - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/service', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/service', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'cookie' => 'a_session_console=' . $this->getRoot()['session'], @@ -1000,7 +1000,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'cookie' => 'a_session_console=' . $this->getRoot()['session'], @@ -1035,7 +1035,7 @@ class ProjectsConsoleClientTest extends Scope // Cleanup foreach ($services as $service) { - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/service/', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/service/', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1062,7 +1062,7 @@ class ProjectsConsoleClientTest extends Scope $key = $service['key'] ?? ''; - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/service', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/service', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'cookie' => 'a_session_console=' . $this->getRoot()['session'], @@ -1074,7 +1074,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'cookie' => 'a_session_console=' . $this->getRoot()['session'], @@ -1086,7 +1086,7 @@ class ProjectsConsoleClientTest extends Scope } // Create API Key - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/keys', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/keys', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'cookie' => 'a_session_console=' . $this->getRoot()['session'], @@ -1125,7 +1125,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); /** Check that the API key has been updated */ - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/keys/' . $keyId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/keys/' . $keyId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'cookie' => 'a_session_console=' . $this->getRoot()['session'], @@ -1141,7 +1141,7 @@ class ProjectsConsoleClientTest extends Scope // Cleanup - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/keys/' . $keyId, array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/project/' . $id . '/keys/' . $keyId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'cookie' => 'a_session_console=' . $this->getRoot()['session'], @@ -1150,7 +1150,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(204, $response['headers']['status-code']); foreach ($services as $service) { - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/service/', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/service/', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1167,7 +1167,7 @@ class ProjectsConsoleClientTest extends Scope { $id = $data['projectId'] ?? ''; - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/webhooks', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/webhooks', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1194,7 +1194,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/webhooks', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/webhooks', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1208,7 +1208,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(400, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/webhooks', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/webhooks', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1252,7 +1252,7 @@ class ProjectsConsoleClientTest extends Scope $id = $data['projectId'] ?? ''; $webhookId = $data['webhookId'] ?? ''; - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/webhooks/' . $webhookId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/webhooks/' . $webhookId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1270,7 +1270,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/webhooks/error', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/webhooks/error', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1288,7 +1288,7 @@ class ProjectsConsoleClientTest extends Scope $id = $data['projectId'] ?? ''; $webhookId = $data['webhookId'] ?? ''; - $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/webhooks/' . $webhookId, array_merge([ + $response = $this->client->call(Client::METHOD_PUT, '/project/' . $id . '/webhooks/' . $webhookId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1314,7 +1314,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals('', $response['body']['httpUser']); $this->assertEquals('', $response['body']['httpPass']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/webhooks/' . $webhookId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/webhooks/' . $webhookId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1336,7 +1336,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/webhooks/' . $webhookId, array_merge([ + $response = $this->client->call(Client::METHOD_PUT, '/project/' . $id . '/webhooks/' . $webhookId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1350,7 +1350,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(400, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/webhooks/' . $webhookId, array_merge([ + $response = $this->client->call(Client::METHOD_PUT, '/project/' . $id . '/webhooks/' . $webhookId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1364,7 +1364,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(400, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/webhooks/' . $webhookId, array_merge([ + $response = $this->client->call(Client::METHOD_PUT, '/project/' . $id . '/webhooks/' . $webhookId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1387,7 +1387,7 @@ class ProjectsConsoleClientTest extends Scope $webhookId = $data['webhookId'] ?? ''; $signatureKey = $data['signatureKey'] ?? ''; - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/webhooks/' . $webhookId . '/signature', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/webhooks/' . $webhookId . '/signature', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1405,7 +1405,7 @@ class ProjectsConsoleClientTest extends Scope $id = $data['projectId'] ?? ''; $webhookId = $data['webhookId'] ?? ''; - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/webhooks/' . $webhookId, array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/project/' . $id . '/webhooks/' . $webhookId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1413,7 +1413,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(204, $response['headers']['status-code']); $this->assertEmpty($response['body']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/webhooks/' . $webhookId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/webhooks/' . $webhookId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1423,7 +1423,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/webhooks/error', array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/project/' . $id . '/webhooks/error', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1442,7 +1442,7 @@ class ProjectsConsoleClientTest extends Scope { $id = $data['projectId'] ?? ''; - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/keys', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/keys', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1469,7 +1469,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/keys', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/keys', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1490,7 +1490,7 @@ class ProjectsConsoleClientTest extends Scope { $id = $data['projectId'] ?? ''; - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/keys', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/keys', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1515,7 +1515,7 @@ class ProjectsConsoleClientTest extends Scope $id = $data['projectId'] ?? ''; $keyId = $data['keyId'] ?? ''; - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/keys/' . $keyId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/keys/' . $keyId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $keyId @@ -1537,7 +1537,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/keys/error', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/keys/error', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1557,7 +1557,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/keys', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/keys', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1577,7 +1577,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/keys', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/keys', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1597,7 +1597,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/keys', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/keys', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1624,7 +1624,7 @@ class ProjectsConsoleClientTest extends Scope $id = $data['projectId'] ?? ''; $keyId = $data['keyId'] ?? ''; - $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/keys/' . $keyId, array_merge([ + $response = $this->client->call(Client::METHOD_PUT, '/project/' . $id . '/keys/' . $keyId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1646,7 +1646,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertArrayHasKey('accessedAt', $response['body']); $this->assertEmpty($response['body']['accessedAt']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/keys/' . $keyId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/keys/' . $keyId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1667,7 +1667,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/keys/' . $keyId, array_merge([ + $response = $this->client->call(Client::METHOD_PUT, '/project/' . $id . '/keys/' . $keyId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1688,7 +1688,7 @@ class ProjectsConsoleClientTest extends Scope $id = $data['projectId'] ?? ''; $keyId = $data['keyId'] ?? ''; - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/keys/' . $keyId, array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/project/' . $id . '/keys/' . $keyId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1696,7 +1696,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(204, $response['headers']['status-code']); $this->assertEmpty($response['body']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/keys/' . $keyId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/keys/' . $keyId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1706,7 +1706,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/keys/error', array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/project/' . $id . '/keys/error', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1725,7 +1725,7 @@ class ProjectsConsoleClientTest extends Scope { $id = $data['projectId'] ?? ''; - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/platforms', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/platforms', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1746,7 +1746,7 @@ class ProjectsConsoleClientTest extends Scope $data = array_merge($data, ['platformWebId' => $response['body']['$id']]); - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/platforms', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/platforms', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1767,7 +1767,7 @@ class ProjectsConsoleClientTest extends Scope $data = array_merge($data, ['platformFultteriOSId' => $response['body']['$id']]); - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/platforms', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/platforms', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1788,7 +1788,7 @@ class ProjectsConsoleClientTest extends Scope $data = array_merge($data, ['platformFultterAndroidId' => $response['body']['$id']]); - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/platforms', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/platforms', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1809,7 +1809,7 @@ class ProjectsConsoleClientTest extends Scope $data = array_merge($data, ['platformAppleIosId' => $response['body']['$id']]); - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/platforms', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/platforms', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1830,7 +1830,7 @@ class ProjectsConsoleClientTest extends Scope $data = array_merge($data, ['platformAppleMacOsId' => $response['body']['$id']]); - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/platforms', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/platforms', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1851,7 +1851,7 @@ class ProjectsConsoleClientTest extends Scope $data = array_merge($data, ['platformAppleWatchOsId' => $response['body']['$id']]); - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/platforms', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/platforms', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1875,7 +1875,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/platforms', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/platforms', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1900,7 +1900,7 @@ class ProjectsConsoleClientTest extends Scope sleep(1); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/platforms', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/platforms', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1924,7 +1924,7 @@ class ProjectsConsoleClientTest extends Scope $platformWebId = $data['platformWebId'] ?? ''; - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/platforms/' . $platformWebId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/platforms/' . $platformWebId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1940,7 +1940,7 @@ class ProjectsConsoleClientTest extends Scope $platformFultteriOSId = $data['platformFultteriOSId'] ?? ''; - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/platforms/' . $platformFultteriOSId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/platforms/' . $platformFultteriOSId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1956,7 +1956,7 @@ class ProjectsConsoleClientTest extends Scope $platformFultterAndroidId = $data['platformFultterAndroidId'] ?? ''; - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/platforms/' . $platformFultterAndroidId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/platforms/' . $platformFultterAndroidId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1972,7 +1972,7 @@ class ProjectsConsoleClientTest extends Scope $platformAppleIosId = $data['platformAppleIosId'] ?? ''; - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/platforms/' . $platformAppleIosId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/platforms/' . $platformAppleIosId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -1988,7 +1988,7 @@ class ProjectsConsoleClientTest extends Scope $platformAppleMacOsId = $data['platformAppleMacOsId'] ?? ''; - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/platforms/' . $platformAppleMacOsId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/platforms/' . $platformAppleMacOsId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2004,7 +2004,7 @@ class ProjectsConsoleClientTest extends Scope $platformAppleWatchOsId = $data['platformAppleWatchOsId'] ?? ''; - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/platforms/' . $platformAppleWatchOsId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/platforms/' . $platformAppleWatchOsId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2020,7 +2020,7 @@ class ProjectsConsoleClientTest extends Scope $platformAppleTvOsId = $data['platformAppleTvOsId'] ?? ''; - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/platforms/' . $platformAppleTvOsId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/platforms/' . $platformAppleTvOsId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2037,7 +2037,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/platforms/error', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/platforms/error', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2056,7 +2056,7 @@ class ProjectsConsoleClientTest extends Scope $platformWebId = $data['platformWebId'] ?? ''; - $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/platforms/' . $platformWebId, array_merge([ + $response = $this->client->call(Client::METHOD_PUT, '/project/' . $id . '/platforms/' . $platformWebId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2077,7 +2077,7 @@ class ProjectsConsoleClientTest extends Scope $platformFultteriOSId = $data['platformFultteriOSId'] ?? ''; - $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/platforms/' . $platformFultteriOSId, array_merge([ + $response = $this->client->call(Client::METHOD_PUT, '/project/' . $id . '/platforms/' . $platformFultteriOSId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2098,7 +2098,7 @@ class ProjectsConsoleClientTest extends Scope $platformFultterAndroidId = $data['platformFultterAndroidId'] ?? ''; - $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/platforms/' . $platformFultterAndroidId, array_merge([ + $response = $this->client->call(Client::METHOD_PUT, '/project/' . $id . '/platforms/' . $platformFultterAndroidId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2119,7 +2119,7 @@ class ProjectsConsoleClientTest extends Scope $platformAppleIosId = $data['platformAppleIosId'] ?? ''; - $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/platforms/' . $platformAppleIosId, array_merge([ + $response = $this->client->call(Client::METHOD_PUT, '/project/' . $id . '/platforms/' . $platformAppleIosId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2140,7 +2140,7 @@ class ProjectsConsoleClientTest extends Scope $platformAppleMacOsId = $data['platformAppleMacOsId'] ?? ''; - $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/platforms/' . $platformAppleMacOsId, array_merge([ + $response = $this->client->call(Client::METHOD_PUT, '/project/' . $id . '/platforms/' . $platformAppleMacOsId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2161,7 +2161,7 @@ class ProjectsConsoleClientTest extends Scope $platformAppleWatchOsId = $data['platformAppleWatchOsId'] ?? ''; - $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/platforms/' . $platformAppleWatchOsId, array_merge([ + $response = $this->client->call(Client::METHOD_PUT, '/project/' . $id . '/platforms/' . $platformAppleWatchOsId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2182,7 +2182,7 @@ class ProjectsConsoleClientTest extends Scope $platformAppleTvOsId = $data['platformAppleTvOsId'] ?? ''; - $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/platforms/' . $platformAppleTvOsId, array_merge([ + $response = $this->client->call(Client::METHOD_PUT, '/project/' . $id . '/platforms/' . $platformAppleTvOsId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2204,7 +2204,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/platforms/error', array_merge([ + $response = $this->client->call(Client::METHOD_PUT, '/project/' . $id . '/platforms/error', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2228,7 +2228,7 @@ class ProjectsConsoleClientTest extends Scope $platformWebId = $data['platformWebId'] ?? ''; - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/platforms/' . $platformWebId, array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/project/' . $id . '/platforms/' . $platformWebId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2236,7 +2236,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(204, $response['headers']['status-code']); $this->assertEmpty($response['body']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/platforms/' . $platformWebId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/platforms/' . $platformWebId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2245,7 +2245,7 @@ class ProjectsConsoleClientTest extends Scope $platformFultteriOSId = $data['platformFultteriOSId'] ?? ''; - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/platforms/' . $platformFultteriOSId, array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/project/' . $id . '/platforms/' . $platformFultteriOSId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2253,7 +2253,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(204, $response['headers']['status-code']); $this->assertEmpty($response['body']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/platforms/' . $platformFultteriOSId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/platforms/' . $platformFultteriOSId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2262,7 +2262,7 @@ class ProjectsConsoleClientTest extends Scope $platformFultterAndroidId = $data['platformFultterAndroidId'] ?? ''; - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/platforms/' . $platformFultterAndroidId, array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/project/' . $id . '/platforms/' . $platformFultterAndroidId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2270,7 +2270,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(204, $response['headers']['status-code']); $this->assertEmpty($response['body']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/platforms/' . $platformFultterAndroidId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/platforms/' . $platformFultterAndroidId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2279,7 +2279,7 @@ class ProjectsConsoleClientTest extends Scope $platformAppleIosId = $data['platformAppleIosId'] ?? ''; - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/platforms/' . $platformAppleIosId, array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/project/' . $id . '/platforms/' . $platformAppleIosId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2287,7 +2287,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(204, $response['headers']['status-code']); $this->assertEmpty($response['body']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/platforms/' . $platformAppleIosId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/platforms/' . $platformAppleIosId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2296,7 +2296,7 @@ class ProjectsConsoleClientTest extends Scope $platformAppleMacOsId = $data['platformAppleMacOsId'] ?? ''; - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/platforms/' . $platformAppleMacOsId, array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/project/' . $id . '/platforms/' . $platformAppleMacOsId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2304,7 +2304,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(204, $response['headers']['status-code']); $this->assertEmpty($response['body']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/platforms/' . $platformAppleMacOsId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/platforms/' . $platformAppleMacOsId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2313,7 +2313,7 @@ class ProjectsConsoleClientTest extends Scope $platformAppleWatchOsId = $data['platformAppleWatchOsId'] ?? ''; - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/platforms/' . $platformAppleWatchOsId, array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/project/' . $id . '/platforms/' . $platformAppleWatchOsId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2321,7 +2321,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(204, $response['headers']['status-code']); $this->assertEmpty($response['body']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/platforms/' . $platformAppleWatchOsId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/platforms/' . $platformAppleWatchOsId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2330,7 +2330,7 @@ class ProjectsConsoleClientTest extends Scope $platformAppleTvOsId = $data['platformAppleTvOsId'] ?? ''; - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/platforms/' . $platformAppleTvOsId, array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/project/' . $id . '/platforms/' . $platformAppleTvOsId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2338,7 +2338,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(204, $response['headers']['status-code']); $this->assertEmpty($response['body']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/platforms/' . $platformAppleTvOsId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/platforms/' . $platformAppleTvOsId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2348,7 +2348,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/webhooks/error', array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/project/' . $id . '/webhooks/error', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2367,7 +2367,7 @@ class ProjectsConsoleClientTest extends Scope { $id = $data['projectId'] ?? ''; - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/domains', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/domains', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2387,7 +2387,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/platforms', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/platforms', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2396,7 +2396,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(400, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/platforms', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/project/' . $id . '/platforms', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2417,7 +2417,7 @@ class ProjectsConsoleClientTest extends Scope { $id = $data['projectId'] ?? ''; - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/domains', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/domains', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2440,7 +2440,7 @@ class ProjectsConsoleClientTest extends Scope $id = $data['projectId'] ?? ''; $domainId = $data['domainId'] ?? ''; - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/domains/' . $domainId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/domains/' . $domainId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2457,7 +2457,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/domains/error', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/domains/error', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2475,7 +2475,7 @@ class ProjectsConsoleClientTest extends Scope $id = $data['projectId'] ?? ''; $domainId = $data['domainId'] ?? ''; - $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/domains/' . $domainId . '/verification', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/project/' . $id . '/domains/' . $domainId . '/verification', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2497,7 +2497,7 @@ class ProjectsConsoleClientTest extends Scope $id = $data['projectId'] ?? ''; $domainId = $data['domainId'] ?? ''; - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/domains/' . $domainId, array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/project/' . $id . '/domains/' . $domainId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2505,7 +2505,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(204, $response['headers']['status-code']); $this->assertEmpty($response['body']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/domains/' . $domainId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/project/' . $id . '/domains/' . $domainId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2515,7 +2515,7 @@ class ProjectsConsoleClientTest extends Scope /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/domains/error', array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/project/' . $id . '/domains/error', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -2544,7 +2544,7 @@ class ProjectsConsoleClientTest extends Scope $teamId = $team['body']['$id']; - $project = $this->client->call(Client::METHOD_POST, '/projects', array_merge([ + $project = $this->client->call(Client::METHOD_POST, '/project', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2569,7 +2569,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(200, $team['headers']['status-code']); - $project = $this->client->call(Client::METHOD_GET, '/projects/' . $projectId, array_merge([ + $project = $this->client->call(Client::METHOD_GET, '/project/' . $projectId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -2577,7 +2577,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(200, $project['headers']['status-code']); // Delete team - $team = $this->client->call(Client::METHOD_DELETE, '/projects/' . $projectId, array_merge([ + $team = $this->client->call(Client::METHOD_DELETE, '/project/' . $projectId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2594,7 +2594,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(200, $team['headers']['status-code']); - $project = $this->client->call(Client::METHOD_GET, '/projects/' . $projectId, array_merge([ + $project = $this->client->call(Client::METHOD_GET, '/project/' . $projectId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()));