From 4b909ed7dc5ff69d43963ad741b0a7e54496784e Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Thu, 13 Feb 2025 00:23:13 +0530 Subject: [PATCH] Create rule in function logging test --- .../Functions/FunctionsCustomServerTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 79f3e33c10..94b1fe76b5 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -1954,6 +1954,24 @@ class FunctionsCustomServerTest extends Scope $functionId = $function['body']['$id'] ?? ''; + $rule = $this->client->call( + Client::METHOD_POST, + '/proxy/rules', + array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), + [ + 'domain' => 'test-' . ID::unique() . System::getEnv('_APP_DOMAIN_FUNCTIONS'), + 'resourceType' => 'function', + 'resourceId' => $functionId, + ], + ); + + $this->assertEquals(201, $rule['headers']['status-code']); + $this->assertNotEmpty($rule['body']['$id']); + $this->assertNotEmpty($rule['body']['domain']); + $this->setupDeployment($functionId, [ 'code' => $this->packageFunction('node'), 'activate' => true