fix X-Appwrite-Response-Format

This commit is contained in:
fogelito
2026-03-04 15:45:04 +02:00
parent 5c20e8eb56
commit 1dacf0afed
2 changed files with 8 additions and 2 deletions
@@ -3541,7 +3541,6 @@ trait DatabasesBase
* Use specific X-Appwrite-Response-Format 1.8.0
*/
$response = $this->client->call(Client::METHOD_GET, $this->getRecordUrl($databaseId, $document[$this->getContainerIdResponseKey()]), array_merge([
//$response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $document['$collectionId'] . '/documents', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'X-Appwrite-Response-Format' => '1.8.0',
@@ -421,14 +421,21 @@ class ProjectsConsoleClientTest extends Scope
], $this->getHeaders()), [
'queries' => [
'{"method":"select","values":["name", "$createdAt"]}',
'{"method":"limit","values":[2]}',
]
]);
$this->assertEquals(200, $list['headers']['status-code']);
$this->assertEquals(6, $list['body']['total']);
$this->assertEquals(2, $list['body']['total']);
$project = $list['body']['projects'][0];
$this->assertEquals('Project Test', $project['name']);
$this->assertArrayHasKey('$id', $project);
$this->assertArrayHasKey('$sequence', $project);
$this->assertArrayHasKey('$permissions', $project);
$this->assertArrayHasKey('$createdAt', $project);
$this->assertArrayHasKey('$updatedAt', $project);
$this->assertArrayHasKey('name', $project);
$this->assertArrayNotHasKey('platforms', $project);
}