1
0
Fork 0
mirror of synced 2024-10-03 19:53:33 +13:00

addressing comments

This commit is contained in:
shimon 2023-02-02 15:55:50 +02:00
parent c91588307f
commit dbc5266d7d
2 changed files with 3 additions and 6 deletions

View file

@ -118,7 +118,6 @@ class UsageTest extends Scope
'x-appwrite-mode' => 'admin' 'x-appwrite-mode' => 'admin'
])); ]));
$requestsCount++; $requestsCount++;
$res = $res['body']; $res = $res['body'];
$this->assertEquals(10, $res['usersCreate'][array_key_last($res['usersCreate'])]['value']); $this->assertEquals(10, $res['usersCreate'][array_key_last($res['usersCreate'])]['value']);
$this->validateDates($res['usersCreate']); $this->validateDates($res['usersCreate']);
@ -289,7 +288,6 @@ class UsageTest extends Scope
$this->assertEquals($storageTotal, $res['storage'][array_key_last($res['storage'])]['value']); $this->assertEquals($storageTotal, $res['storage'][array_key_last($res['storage'])]['value']);
$this->validateDates($res['storage']); $this->validateDates($res['storage']);
$requestsCount++; $requestsCount++;
$res = $this->client->call(Client::METHOD_GET, '/storage/usage?range=30d', array_merge($headers, [ $res = $this->client->call(Client::METHOD_GET, '/storage/usage?range=30d', array_merge($headers, [
'x-appwrite-project' => $projectId, 'x-appwrite-project' => $projectId,
'x-appwrite-mode' => 'admin' 'x-appwrite-mode' => 'admin'
@ -315,7 +313,6 @@ class UsageTest extends Scope
$this->assertEquals($filesDelete, $res['filesDelete'][array_key_last($res['filesDelete'])]['value']); $this->assertEquals($filesDelete, $res['filesDelete'][array_key_last($res['filesDelete'])]['value']);
$this->validateDates($res['filesDelete']); $this->validateDates($res['filesDelete']);
$requestsCount++; $requestsCount++;
$res = $this->client->call(Client::METHOD_GET, '/storage/' . $bucketId . '/usage?range=30d', array_merge($headers, [ $res = $this->client->call(Client::METHOD_GET, '/storage/' . $bucketId . '/usage?range=30d', array_merge($headers, [
'x-appwrite-project' => $projectId, 'x-appwrite-project' => $projectId,
'x-appwrite-mode' => 'admin' '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($filesRead, $res['filesRead'][array_key_last($res['filesRead'])]['value']);
$this->assertEquals($filesCreate, $res['filesCreate'][array_key_last($res['filesCreate'])]['value']); $this->assertEquals($filesCreate, $res['filesCreate'][array_key_last($res['filesCreate'])]['value']);
$this->assertEquals($filesDelete, $res['filesDelete'][array_key_last($res['filesDelete'])]['value']); $this->assertEquals($filesDelete, $res['filesDelete'][array_key_last($res['filesDelete'])]['value']);
$requestsCount++; $requestsCount++;
$data['requestsCount'] = $requestsCount; $data['requestsCount'] = $requestsCount;
return $data; return $data;
@ -360,7 +358,7 @@ class UsageTest extends Scope
for ($i = 0; $i < 10; $i++) { for ($i = 0; $i < 10; $i++) {
$name = uniqid() . ' database'; $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()', 'databaseId' => 'unique()',
'name' => $name, 'name' => $name,
]); ]);

View file

@ -106,7 +106,6 @@ class RealtimeCustomClientTest extends Scope
$this->assertContains('collections.1.documents.1', $response['data']['channels']); $this->assertContains('collections.1.documents.1', $response['data']['channels']);
$this->assertContains('collections.2.documents.2', $response['data']['channels']); $this->assertContains('collections.2.documents.2', $response['data']['channels']);
$this->assertEquals($userId, $response['data']['user']['$id']); $this->assertEquals($userId, $response['data']['user']['$id']);
$client->close(); $client->close();
} }
@ -461,7 +460,7 @@ class RealtimeCustomClientTest extends Scope
/** /**
* Test Account Session Create * Test Account Session Create
*/ */
$response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([
'origin' => 'http://localhost', 'origin' => 'http://localhost',
'content-type' => 'application/json', 'content-type' => 'application/json',