Fix failing tests

This commit is contained in:
Matej Bačo
2026-04-08 10:52:20 +02:00
parent b8d65326e6
commit f880b6e8c3
3 changed files with 13 additions and 3 deletions
@@ -71,6 +71,9 @@ class V21 extends Filter
case 'webhooks.create':
$content = $this->fillWebhookid($content);
break;
case 'project.createKey':
$content = $this->fillKeyId($content);
break;
case 'project.createVariable':
$content = $this->fillVariableId($content);
break;
@@ -122,6 +125,12 @@ class V21 extends Filter
return $content;
}
protected function fillKeyId(array $content): array
{
$content['keyId'] = $content['keyId'] ?? 'unique()';
return $content;
}
protected function fillVariableId(array $content): array
{
$content['variableId'] = $content['variableId'] ?? 'unique()';
@@ -120,6 +120,7 @@ trait ProjectsBase
$response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/keys', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-response-format' => '1.8.0',
], $this->getHeaders()), [
'name' => 'Key Test',
'scopes' => ['teams.read', 'teams.write'],
@@ -3161,7 +3161,7 @@ class ProjectsConsoleClientTest extends Scope
$response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/keys', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-response-format' => '1.9.0',
'x-appwrite-response-format' => '1.8.0',
], $this->getHeaders()), [
'name' => 'Key Custom',
'scopes' => ['teams.read', 'teams.write'],
@@ -3247,7 +3247,7 @@ class ProjectsConsoleClientTest extends Scope
$response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/keys', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-response-format' => '1.9.0',
'x-appwrite-response-format' => '1.8.0',
], $this->getHeaders()), [
'name' => 'Key Test 2',
'scopes' => ['users.read'],
@@ -3623,7 +3623,7 @@ class ProjectsConsoleClientTest extends Scope
$response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/keys', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-response-format' => '1.9.0',
'x-appwrite-response-format' => '1.8.0',
], $this->getHeaders()), [
'name' => 'Key For Deletion',
'scopes' => ['teams.read', 'teams.write'],