1
0
Fork 0
mirror of synced 2024-06-29 11:40:45 +12:00

Storage test fixes

This commit is contained in:
Jake Barnby 2022-08-08 23:00:15 +12:00
parent 8317b167ce
commit cb7bafbdc0
3 changed files with 12 additions and 6 deletions

View file

@ -300,7 +300,7 @@ trait StorageBase
//$this->assertNotEmpty($file1['body']['fileOpenSSLTag']);
//$this->assertNotEmpty($file1['body']['fileOpenSSLIV']);
$this->assertIsArray($file1['body']['$permissions']);
$this->assertCount(2, $file1['body']['$permissions']);
$this->assertCount(4, $file1['body']['$permissions']);
$file2 = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucketId . '/files/' . $data['fileId'] . '/preview', array_merge([
'content-type' => 'application/json',
@ -604,7 +604,7 @@ trait StorageBase
//$this->assertNotEmpty($file['body']['fileOpenSSLTag']);
//$this->assertNotEmpty($file['body']['fileOpenSSLIV']);
$this->assertIsArray($file['body']['$permissions']);
$this->assertCount(2, $file['body']['$permissions']);
$this->assertCount(4, $file['body']['$permissions']);
/**
* Test for FAILURE unknown Bucket

View file

@ -185,7 +185,11 @@ class StorageCustomClientTest extends Scope
'fileId' => 'unique()',
'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/logo.png'), 'image/png', 'permissions.png'),
'folderId' => 'xyz',
'write' => ['user:notme']
'permissions' => [
'create(user:notme)',
'update(user:notme)',
'delete(user:notme)',
]
]);
$this->assertEquals($file['headers']['status-code'], 400);
@ -243,7 +247,11 @@ class StorageCustomClientTest extends Scope
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'write' => ['user:notme']
'permissions' => [
'create(user:notme)',
'update(user:notme)',
'delete(user:notme)',
]
]);
$this->assertEquals($file['headers']['status-code'], 400);

View file

@ -227,8 +227,6 @@ class MessagingTest extends TestCase
])
);
\var_dump($result);
$this->assertContains('any', $result['roles']);
$this->assertNotContains('role:admin', $result['roles']);