From ca03176ad614e4e1059a6efaf85fd867d7814045 Mon Sep 17 00:00:00 2001 From: fogelito Date: Wed, 4 Feb 2026 09:53:19 +0200 Subject: [PATCH] $this->webEndpoint, --- tests/e2e/General/CompressionTest.php | 7 ++-- tests/e2e/Scopes/Scope.php | 3 +- .../Services/Migrations/MigrationsBase.php | 32 +++++++------------ 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/tests/e2e/General/CompressionTest.php b/tests/e2e/General/CompressionTest.php index cff23b1201..29ec0ea1e8 100644 --- a/tests/e2e/General/CompressionTest.php +++ b/tests/e2e/General/CompressionTest.php @@ -86,8 +86,11 @@ class CompressionTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertArrayNotHasKey('content-encoding', $response['headers']); - $this->assertEquals('chunked', $response['headers']['transfer-encoding'] ?? null, 'Uncompressed response should use chunked transfer, headers received: ' . json_encode($response['headers'], JSON_PRETTY_PRINT)); - $this->assertArrayNotHasKey('content-length', $response['headers'], 'Uncompressed response should not send content length when chunked.'); + + if ($this->endpoint !== 'http://appwrite/v1'){ + $this->assertEquals('chunked', $response['headers']['transfer-encoding'] ?? null, 'Uncompressed response should use chunked transfer, headers received: ' . json_encode($response['headers'], JSON_PRETTY_PRINT)); + $this->assertArrayNotHasKey('content-length', $response['headers'], 'Uncompressed response should not send content length when chunked.'); + } $this->assertArrayHasKey('longValue', $response['body'], 'Prefs payload should expose longValue at the top level, body received: ' . json_encode($response['body'], JSON_PRETTY_PRINT)); diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php index cd5996ba83..91ef7cbb62 100644 --- a/tests/e2e/Scopes/Scope.php +++ b/tests/e2e/Scopes/Scope.php @@ -18,8 +18,7 @@ abstract class Scope extends TestCase public const REQUEST_TYPE_SMS = 'sms'; protected ?Client $client = null; - //protected string $endpoint = 'http://appwrite.test/v1'; - //protected string $endpoint = 'http://localhost/v1'; + protected string $webEndpoint = 'http://appwrite.test/v1'; protected string $endpoint = 'http://appwrite/v1'; protected function setUp(): void diff --git a/tests/e2e/Services/Migrations/MigrationsBase.php b/tests/e2e/Services/Migrations/MigrationsBase.php index 0dde9b8ed9..aad0b73aa9 100644 --- a/tests/e2e/Services/Migrations/MigrationsBase.php +++ b/tests/e2e/Services/Migrations/MigrationsBase.php @@ -24,14 +24,6 @@ trait MigrationsBase */ protected static array $destinationProject = []; - /** - * @return string - */ - public function getEndPoint():string - { - return 'http://appwrite.test/v1'; - } - /** * @param bool $fresh * @return array @@ -97,7 +89,7 @@ trait MigrationsBase { $response = $this->performMigrationSync([ 'resources' => Appwrite::getSupportedResources(), - 'endpoint' => $this->getEndPoint(), + 'endpoint' => $this->webEndpoint, 'projectId' => $this->getProject()['$id'], 'apiKey' => $this->getProject()['apiKey'], ]); @@ -134,7 +126,7 @@ trait MigrationsBase 'resources' => [ Resource::TYPE_USER, ], - 'endpoint' => $this->getEndPoint(), + 'endpoint' => $this->webEndpoint, 'projectId' => $this->getProject()['$id'], 'apiKey' => $this->getProject()['apiKey'], ]); @@ -196,7 +188,7 @@ trait MigrationsBase 'resources' => [ Resource::TYPE_USER, ], - 'endpoint' => $this->getEndPoint(), + 'endpoint' => $this->webEndpoint, 'projectId' => $this->getProject()['$id'], 'apiKey' => $this->getProject()['apiKey'], ]); @@ -285,7 +277,7 @@ trait MigrationsBase Resource::TYPE_TEAM, Resource::TYPE_MEMBERSHIP, ], - 'endpoint' => $this->getEndPoint(), + 'endpoint' => $this->webEndpoint, 'projectId' => $this->getProject()['$id'], 'apiKey' => $this->getProject()['apiKey'], ]); @@ -401,7 +393,7 @@ trait MigrationsBase 'resources' => [ Resource::TYPE_DATABASE, ], - 'endpoint' => $this->getEndPoint(), + 'endpoint' => $this->webEndpoint, 'projectId' => $this->getProject()['$id'], 'apiKey' => $this->getProject()['apiKey'], ]); @@ -492,7 +484,7 @@ trait MigrationsBase Resource::TYPE_TABLE, Resource::TYPE_COLUMN, ], - 'endpoint' => $this->getEndPoint(), + 'endpoint' => $this->webEndpoint, 'projectId' => $this->getProject()['$id'], 'apiKey' => $this->getProject()['apiKey'], ]); @@ -579,7 +571,7 @@ trait MigrationsBase Resource::TYPE_COLUMN, Resource::TYPE_ROW, ], - 'endpoint' => $this->getEndPoint(), + 'endpoint' => $this->webEndpoint, 'projectId' => $this->getProject()['$id'], 'apiKey' => $this->getProject()['apiKey'], ]); @@ -659,7 +651,7 @@ trait MigrationsBase 'resources' => [ Resource::TYPE_BUCKET ], - 'endpoint' => $this->getEndPoint(), + 'endpoint' => $this->webEndpoint, 'projectId' => $this->getProject()['$id'], 'apiKey' => $this->getProject()['apiKey'], ]); @@ -755,7 +747,7 @@ trait MigrationsBase Resource::TYPE_BUCKET, Resource::TYPE_FILE ], - 'endpoint' => $this->getEndPoint(), + 'endpoint' => $this->webEndpoint, 'projectId' => $this->getProject()['$id'], 'apiKey' => $this->getProject()['apiKey'], ]); @@ -826,7 +818,7 @@ trait MigrationsBase Resource::TYPE_FUNCTION, Resource::TYPE_DEPLOYMENT ], - 'endpoint' => $this->getEndPoint(), + 'endpoint' => $this->webEndpoint, 'projectId' => $this->getProject()['$id'], 'apiKey' => $this->getProject()['apiKey'], ]); @@ -1127,7 +1119,7 @@ trait MigrationsBase // all data exists, pass. $migration = $this->performCsvMigration( [ - 'endpoint' => $this->getEndPoint(), + 'endpoint' => $this->webEndpoint, 'fileId' => $fileIds['default'], 'bucketId' => $bucketIds['default'], 'resourceId' => $databaseId . ':' . $tableId, @@ -1169,7 +1161,7 @@ trait MigrationsBase // all data exists and includes internals, pass. $migration = $this->performCsvMigration( [ - 'endpoint' => $this->getEndPoint(), + 'endpoint' => $this->webEndpoint, 'fileId' => $fileIds['documents-internals'], 'bucketId' => $bucketIds['documents-internals'], 'resourceId' => $databaseId . ':' . $tableId,