From 43ba14fb75cda5ee972fc257f9e08695de2ac698 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 22 Aug 2023 21:35:00 -0400 Subject: [PATCH] Fix console tests --- app/console | 2 +- app/controllers/api/console.php | 6 +++++- tests/e2e/Services/Console/ConsoleConsoleClientTest.php | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/console b/app/console index 9865be05f8..2965a7d661 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit 9865be05f85a36904c308577c53cabc0a8d3120a +Subproject commit 2965a7d661f186a3631794969463717f46159945 diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index 357db021c2..87af828cae 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -30,7 +30,11 @@ App::get('/v1/console/variables') ->inject('response') ->action(function (Response $response) { - $isVcsEnabled = !empty(App::getEnv('_APP_VCS_GITHUB_APP_NAME', '')) && !empty(App::getEnv('_APP_VCS_GITHUB_PRIVATE_KEY', '')) && !empty(App::getEnv('_APP_VCS_GITHUB_APP_ID', '')) && !empty(App::getEnv('_APP_VCS_GITHUB_CLIENT_ID', '')) && !empty(App::getEnv('_APP_VCS_GITHUB_CLIENT_SECRET', '')); + $isVcsEnabled = !empty(App::getEnv('_APP_VCS_GITHUB_APP_NAME', '')) + && !empty(App::getEnv('_APP_VCS_GITHUB_PRIVATE_KEY', '')) + && !empty(App::getEnv('_APP_VCS_GITHUB_APP_ID', '')) + && !empty(App::getEnv('_APP_VCS_GITHUB_CLIENT_ID', '')) + && !empty(App::getEnv('_APP_VCS_GITHUB_CLIENT_SECRET', '')); $isAssistantEnabled = !empty(App::getEnv('_APP_ASSISTANT_OPENAI_API_KEY', '')); diff --git a/tests/e2e/Services/Console/ConsoleConsoleClientTest.php b/tests/e2e/Services/Console/ConsoleConsoleClientTest.php index bb6176cc62..dfe4737c3e 100644 --- a/tests/e2e/Services/Console/ConsoleConsoleClientTest.php +++ b/tests/e2e/Services/Console/ConsoleConsoleClientTest.php @@ -21,7 +21,7 @@ class ConsoleConsoleClientTest extends Scope $response = $this->client->call(Client::METHOD_GET, '/console/variables', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), []); + ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); $this->assertCount(6, $response['body']); @@ -29,7 +29,7 @@ class ConsoleConsoleClientTest extends Scope $this->assertIsInt($response['body']['_APP_STORAGE_LIMIT']); $this->assertIsInt($response['body']['_APP_FUNCTIONS_SIZE_LIMIT']); $this->assertIsString($response['body']['_APP_DOMAIN_TARGET']); - $this->assertIsString($response['body']['_APP_VCS_ENABLED']); - $this->assertIsString($response['body']['_APP_ASSISTANT_ENABLED']); + $this->assertIsBool($response['body']['_APP_VCS_ENABLED']); + $this->assertIsBool($response['body']['_APP_ASSISTANT_ENABLED']); } }