mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Fix failing tests
This commit is contained in:
@@ -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'],
|
||||
|
||||
Reference in New Issue
Block a user