Add test for endpoint

This commit is contained in:
Khushboo Verma 2024-07-26 17:59:18 +05:30
parent de114e61cd
commit af94fc7882

View file

@ -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]);
}
}