1
0
Fork 0
mirror of synced 2024-07-03 13:41:01 +12:00

fix usage test

This commit is contained in:
Damodar Lohani 2021-09-13 14:03:40 +05:45
parent 6d3a78f7a9
commit a3a97540f3

View file

@ -46,11 +46,22 @@ class StorageConsoleClientTest extends Scope
public function testGetStorageBucketUsage()
{
//create bucket
$bucket = $this->client->call(Client::METHOD_POST, '/storage/buckets', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'bucketId' => 'unique()',
'name' => 'Test Bucket',
]);
$this->assertEquals(201, $bucket['headers']['status-code']);
$bucketId = $bucket['body']['$id'];
/**
* Test for FAILURE
*/
$response = $this->client->call(Client::METHOD_GET, '/storage/default/usage', array_merge([
$response = $this->client->call(Client::METHOD_GET, '/storage/' . $bucketId . '/usage', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id']
], $this->getHeaders()), [
@ -73,7 +84,7 @@ class StorageConsoleClientTest extends Scope
/**
* Test for SUCCESS
*/
$response = $this->client->call(Client::METHOD_GET, '/storage/default/usage', array_merge([
$response = $this->client->call(Client::METHOD_GET, '/storage/' . $bucketId . '/usage', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id']
], $this->getHeaders()), [