mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
add: tests.
This commit is contained in:
@@ -105,6 +105,16 @@ class StorageServerTest extends Scope
|
||||
$buckets = $buckets['body']['data']['storageListBuckets'];
|
||||
$this->assertIsArray($buckets);
|
||||
|
||||
if (!empty($buckets['buckets'])) {
|
||||
foreach ($buckets['buckets'] as $bucket) {
|
||||
$this->assertArrayHasKey('totalSize', $bucket);
|
||||
$this->assertIsInt($bucket['totalSize']);
|
||||
|
||||
/* always 0 because the stats worker runs hourly! */
|
||||
$this->assertGreaterThanOrEqual(0, $bucket['totalSize']);
|
||||
}
|
||||
}
|
||||
|
||||
return $buckets;
|
||||
}
|
||||
|
||||
|
||||
@@ -96,6 +96,14 @@ class StorageCustomServerTest extends Scope
|
||||
$this->assertEquals($id, $response['body']['buckets'][0]['$id']);
|
||||
$this->assertEquals('Test Bucket', $response['body']['buckets'][0]['name']);
|
||||
|
||||
foreach ($response['body']['buckets'] as $bucket) {
|
||||
$this->assertArrayHasKey('totalSize', $bucket);
|
||||
$this->assertIsInt($bucket['totalSize']);
|
||||
|
||||
/* always 0 because the stats worker runs hourly! */
|
||||
$this->assertGreaterThanOrEqual(0, $bucket['totalSize']);
|
||||
}
|
||||
|
||||
$response = $this->client->call(Client::METHOD_GET, '/storage/buckets', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
|
||||
Reference in New Issue
Block a user