From c24cebf6ce32566c00a307489bb64bc20dc7884c Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Tue, 18 Feb 2025 12:50:09 +0530 Subject: [PATCH] Fix site tests --- tests/e2e/Services/Sites/SitesCustomServerTest.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/tests/e2e/Services/Sites/SitesCustomServerTest.php b/tests/e2e/Services/Sites/SitesCustomServerTest.php index 0ff6652ed5..3fde0ba175 100644 --- a/tests/e2e/Services/Sites/SitesCustomServerTest.php +++ b/tests/e2e/Services/Sites/SitesCustomServerTest.php @@ -11,7 +11,6 @@ use Utopia\Database\Document; use Utopia\Database\Helpers\ID; use Utopia\Database\Query; use Utopia\Database\Validator\Datetime as DatetimeValidator; -use Utopia\System\System; class SitesCustomServerTest extends Scope { @@ -1320,17 +1319,10 @@ class SitesCustomServerTest extends Scope 'fallbackFile' => '', ]); - $rule = $this->client->call(Client::METHOD_POST, '/proxy/rules', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'domain' => $subdomain . System::getEnv('_APP_DOMAIN_SITES', ''), - 'resourceType' => 'site', - 'resourceId' => $siteId, - ]); + $domain = $this->setupSiteDomain($site['body']['$id'], $subdomain); - $this->assertEquals(409, $rule['headers']['status-code']); - $this->assertStringContainsString("Domain already assigned to another resource.", $rule['body']['message']); + $this->assertEquals(409, $domain['headers']['status-code']); + $this->assertStringContainsString("Domain already assigned to another resource.", $domain['body']['message']); $this->cleanupSite($siteId);