mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
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.
This commit is contained in:
1 parent
07f8a4880a
commit
fcbacaa716
1 file changed
+7
-3
@@ -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' => [],
|
||||
|
||||
Reference in new issue
Block a user