From fcbacaa716abb504448aebc0db4ec5fa9fc225c8 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Tue, 15 Sep 2026 14:42:00 +0530 Subject: [PATCH] test: hydrate the generated SDK project through the V28 response filter The SDK hydration test now builds the project response the way the server does, running output() and then the V28 filter that older response formats receive, instead of adding devKeys to the fixture by hand. --- tests/unit/Utopia/ResponseTest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/unit/Utopia/ResponseTest.php b/tests/unit/Utopia/ResponseTest.php index 717ffbfad7..4d70b3b399 100644 --- a/tests/unit/Utopia/ResponseTest.php +++ b/tests/unit/Utopia/ResponseTest.php @@ -6,6 +6,7 @@ namespace Tests\Unit\Utopia; use Appwrite\Models\Project as GeneratedProject; use Appwrite\Utopia\Response; +use Appwrite\Utopia\Response\Filters\V28; use Appwrite\Utopia\Response\Model\Project as ProjectModel; use Appwrite\Utopia\Response\Model\Provider as ProviderModel; use Exception; @@ -118,17 +119,20 @@ final class ResponseTest extends TestCase $this->response->setModel(new ProjectModel()); $this->response->setModel(new ProviderModel()); - $project = $this->response->output(new Document([ + // The generated PHP SDK sends a response format older than 2.3.0, so its responses pass through V28. + $this->response->addFilter(new V28()); + + $document = new Document([ '$id' => 'project', '$createdAt' => '2026-06-19T00:00:00.000+00:00', '$updatedAt' => '2026-06-19T00:00:00.000+00:00', 'name' => 'Project', 'teamId' => 'team', 'region' => 'default', - ]), Response::MODEL_PROJECT); + ]); + $project = $this->response->applyFilters($this->response->output($document, Response::MODEL_PROJECT), Response::MODEL_PROJECT, raw: $document); $project['wafEnabled'] = false; - $project['devKeys'] = []; $provider = $this->response->output(new Document([ 'credentials' => [],