fix usage test
This commit is contained in:
parent
6d3a78f7a9
commit
a3a97540f3
1 changed files with 13 additions and 2 deletions
|
@ -46,11 +46,22 @@ class StorageConsoleClientTest extends Scope
|
||||||
|
|
||||||
public function testGetStorageBucketUsage()
|
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
|
* 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',
|
'content-type' => 'application/json',
|
||||||
'x-appwrite-project' => $this->getProject()['$id']
|
'x-appwrite-project' => $this->getProject()['$id']
|
||||||
], $this->getHeaders()), [
|
], $this->getHeaders()), [
|
||||||
|
@ -73,7 +84,7 @@ class StorageConsoleClientTest extends Scope
|
||||||
/**
|
/**
|
||||||
* Test for SUCCESS
|
* 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',
|
'content-type' => 'application/json',
|
||||||
'x-appwrite-project' => $this->getProject()['$id']
|
'x-appwrite-project' => $this->getProject()['$id']
|
||||||
], $this->getHeaders()), [
|
], $this->getHeaders()), [
|
||||||
|
|
Loading…
Reference in a new issue