From 6d10550be8a9d82d95b0b031d64b3c16ef97fa20 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 24 Mar 2021 16:56:42 +0100 Subject: [PATCH] add api key to admin calls on tests --- tests/e2e/Services/Realtime/RealtimeBase.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/e2e/Services/Realtime/RealtimeBase.php b/tests/e2e/Services/Realtime/RealtimeBase.php index 1963d9d841..32caea286b 100644 --- a/tests/e2e/Services/Realtime/RealtimeBase.php +++ b/tests/e2e/Services/Realtime/RealtimeBase.php @@ -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);