1
0
Fork 0
mirror of synced 2024-06-02 02:44:47 +12:00

add api key to admin calls on tests

This commit is contained in:
Torsten Dittmann 2021-03-24 16:56:42 +01:00
parent 7641542707
commit 6d10550be8

View file

@ -619,6 +619,7 @@ trait RealtimeBase
$function = $this->client->call(Client::METHOD_POST, '/functions', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey']
], $this->getHeaders()), [
'name' => 'Test',
'env' => 'php-7.4',
@ -634,6 +635,7 @@ trait RealtimeBase
$tag = $this->client->call(Client::METHOD_POST, '/functions/'.$functionId.'/tags', array_merge([
'content-type' => 'multipart/form-data',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey']
], $this->getHeaders()), [
'command' => 'php index.php',
'code' => new CURLFile(realpath(__DIR__ . '/../../../resources/functions/timeout.tar.gz'), 'application/x-gzip', 'php-fx.tar.gz'),
@ -647,6 +649,7 @@ trait RealtimeBase
$response = $this->client->call(Client::METHOD_PATCH, '/functions/'.$functionId.'/tag', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey']
], $this->getHeaders()), [
'tag' => $tagId,
]);
@ -657,6 +660,7 @@ trait RealtimeBase
$execution = $this->client->call(Client::METHOD_POST, '/functions/'.$functionId.'/executions', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey']
], $this->getHeaders()), []);
$this->assertEquals($execution['headers']['status-code'], 201);