New storage test
This commit is contained in:
parent
2e0bec5699
commit
c3b3a66787
1 changed files with 30 additions and 0 deletions
|
@ -42,6 +42,36 @@ class ProjectStorafeTest extends BaseProjects
|
||||||
$this->assertNotEmpty($file['body'][0]['fileOpenSSLTag']);
|
$this->assertNotEmpty($file['body'][0]['fileOpenSSLTag']);
|
||||||
$this->assertNotEmpty($file['body'][0]['fileOpenSSLIV']);
|
$this->assertNotEmpty($file['body'][0]['fileOpenSSLIV']);
|
||||||
|
|
||||||
|
return array_merge($data, ['fileId' => $file['body'][0]['$uid']]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @depends testFileCreateSuccess
|
||||||
|
*/
|
||||||
|
public function testFileReadSuccess(array $data): array
|
||||||
|
{
|
||||||
|
$file = $this->client->call(Client::METHOD_GET, '/storage/files/' . $data['fileId'], [
|
||||||
|
'x-appwrite-project' => $data['projectUid'],
|
||||||
|
'x-appwrite-key' => $data['projectAPIKeySecret'],
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertEquals($file['headers']['status-code'], 200);
|
||||||
|
$this->assertNotEmpty($file['body']['$uid']);
|
||||||
|
$this->assertIsInt($file['body']['dateCreated']);
|
||||||
|
$this->assertEquals('logo.png', $file['body']['name']);
|
||||||
|
$this->assertEquals('image/png', $file['body']['mimeType']);
|
||||||
|
$this->assertEquals(47218, $file['body']['sizeOriginal']);
|
||||||
|
//$this->assertEquals(54944, $file['body']['sizeActual']);
|
||||||
|
//$this->assertEquals('gzip', $file['body']['algorithm']);
|
||||||
|
//$this->assertEquals('1', $file['body']['fileOpenSSLVersion']);
|
||||||
|
//$this->assertEquals('aes-128-gcm', $file['body']['fileOpenSSLCipher']);
|
||||||
|
//$this->assertNotEmpty($file['body']['fileOpenSSLTag']);
|
||||||
|
//$this->assertNotEmpty($file['body']['fileOpenSSLIV']);
|
||||||
|
$this->assertIsArray($file['body']['$permissions']['read']);
|
||||||
|
$this->assertIsArray($file['body']['$permissions']['write']);
|
||||||
|
$this->assertCount(1, $file['body']['$permissions']['read']);
|
||||||
|
$this->assertCount(1, $file['body']['$permissions']['write']);
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue