From dbc5266d7d6b49af01098a06c3f9a6c7970e429d Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 2 Feb 2023 15:55:50 +0200 Subject: [PATCH] addressing comments --- tests/e2e/General/UsageTest.php | 6 ++---- tests/e2e/Services/Realtime/RealtimeCustomClientTest.php | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/e2e/General/UsageTest.php b/tests/e2e/General/UsageTest.php index 8c1da12ae6..5a4e512a54 100644 --- a/tests/e2e/General/UsageTest.php +++ b/tests/e2e/General/UsageTest.php @@ -118,7 +118,6 @@ class UsageTest extends Scope 'x-appwrite-mode' => 'admin' ])); $requestsCount++; - $res = $res['body']; $this->assertEquals(10, $res['usersCreate'][array_key_last($res['usersCreate'])]['value']); $this->validateDates($res['usersCreate']); @@ -289,7 +288,6 @@ class UsageTest extends Scope $this->assertEquals($storageTotal, $res['storage'][array_key_last($res['storage'])]['value']); $this->validateDates($res['storage']); $requestsCount++; - $res = $this->client->call(Client::METHOD_GET, '/storage/usage?range=30d', array_merge($headers, [ 'x-appwrite-project' => $projectId, 'x-appwrite-mode' => 'admin' @@ -315,7 +313,6 @@ class UsageTest extends Scope $this->assertEquals($filesDelete, $res['filesDelete'][array_key_last($res['filesDelete'])]['value']); $this->validateDates($res['filesDelete']); $requestsCount++; - $res = $this->client->call(Client::METHOD_GET, '/storage/' . $bucketId . '/usage?range=30d', array_merge($headers, [ 'x-appwrite-project' => $projectId, 'x-appwrite-mode' => 'admin' @@ -327,6 +324,7 @@ class UsageTest extends Scope $this->assertEquals($filesRead, $res['filesRead'][array_key_last($res['filesRead'])]['value']); $this->assertEquals($filesCreate, $res['filesCreate'][array_key_last($res['filesCreate'])]['value']); $this->assertEquals($filesDelete, $res['filesDelete'][array_key_last($res['filesDelete'])]['value']); + $requestsCount++; $data['requestsCount'] = $requestsCount; return $data; @@ -360,7 +358,7 @@ class UsageTest extends Scope for ($i = 0; $i < 10; $i++) { $name = uniqid() . ' database'; - $res = $this->client->call(Client::METHOD_POST, '/databases', array_merge($headers, ['content-type' => 'multipart/form-data']), [ + $res = $this->client->call(Client::METHOD_POST, '/databases', $headers, [ 'databaseId' => 'unique()', 'name' => $name, ]); diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index 86832f99e1..db4c1b9517 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -106,7 +106,6 @@ class RealtimeCustomClientTest extends Scope $this->assertContains('collections.1.documents.1', $response['data']['channels']); $this->assertContains('collections.2.documents.2', $response['data']['channels']); $this->assertEquals($userId, $response['data']['user']['$id']); - $client->close(); } @@ -461,7 +460,7 @@ class RealtimeCustomClientTest extends Scope /** * Test Account Session Create - */ + */ $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json',