Add subdomain param in functions and tests

This commit is contained in:
Khushboo Verma
2024-11-07 21:55:41 +05:30
parent a031b54feb
commit b88cd8e544
5 changed files with 214 additions and 6 deletions
@@ -36,6 +36,7 @@ class FunctionsCustomServerTest extends Scope
'buckets.*.delete',
],
'timeout' => 10,
'subdomain' => 'test'
]);
$functionId = $functionId = $function['body']['$id'] ?? '';
@@ -1984,4 +1985,25 @@ class FunctionsCustomServerTest extends Scope
$this->cleanupFunction($functionId);
}
/**
* @depends testCreateFunction
*/
public function testUniqueSubdomain(array $data): void
{
$function = $this->createFunction([
'functionId' => ID::unique(),
'name' => 'Test',
'runtime' => 'php-8.0',
'entrypoint' => 'index.php',
'events' => [
'buckets.*.create',
'buckets.*.delete',
],
'timeout' => 10,
'subdomain' => 'test'
]);
$this->assertEquals(400, $function['headers']['status-code']);
}
}