From af94fc7882d623505b3def58a15f537f9a1edbf8 Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Fri, 26 Jul 2024 17:59:18 +0530 Subject: [PATCH] Add test for endpoint --- .../Functions/FunctionsCustomServerTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index c9f9e4443f..bed86a1d72 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -2097,4 +2097,18 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(204, $response['headers']['status-code']); } + + public function testGetFunctionTemplates() + { + $templates = $this->client->call(Client::METHOD_GET, '/functions/templates', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], $this->getHeaders())); + + $this->assertEquals(200, $templates['headers']['status-code']); + $this->assertGreaterThan(0, $templates['body']['total']); + $this->assertIsArray($templates['body']['templates']); + $this->assertArrayHasKey('runtimes', $templates['body']['templates'][0]); + } }