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

Fix tests

This commit is contained in:
Jake Barnby 2022-08-16 23:29:11 +12:00
parent e3ec275a51
commit 24af94c569

View file

@ -44,7 +44,7 @@ class StorageCustomClientTest extends Scope
$bucketId = $bucket['body']['$id'];
$this->assertEquals(201, $bucket['headers']['status-code']);
$this->assertNotEmpty($bucketId);
$file = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucketId . '/files', array_merge([
'content-type' => 'multipart/form-data',
'x-appwrite-project' => $this->getProject()['$id'],
@ -178,7 +178,7 @@ class StorageCustomClientTest extends Scope
],
]);
$this->assertEquals(400, $file['headers']['status-code']);
$this->assertEquals(401, $file['headers']['status-code']);
$this->assertStringStartsWith('Permissions must be one of:', $file['body']['message']);
$this->assertStringContainsString('any', $file['body']['message']);
$this->assertStringContainsString('users', $file['body']['message']);
@ -197,7 +197,7 @@ class StorageCustomClientTest extends Scope
]
]);
$this->assertEquals($file['headers']['status-code'], 400);
$this->assertEquals(401, $file['headers']['status-code']);
$this->assertStringStartsWith('Permissions must be one of:', $file['body']['message']);
$this->assertStringContainsString('any', $file['body']['message']);
$this->assertStringContainsString('users', $file['body']['message']);
@ -217,7 +217,7 @@ class StorageCustomClientTest extends Scope
],
]);
$this->assertEquals($file['headers']['status-code'], 400);
$this->assertEquals(401, $file['headers']['status-code']);
$this->assertStringStartsWith('Permissions must be one of:', $file['body']['message']);
$this->assertStringContainsString('any', $file['body']['message']);
$this->assertStringContainsString('users', $file['body']['message']);
@ -236,12 +236,12 @@ class StorageCustomClientTest extends Scope
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'permissions' => [
Permission::read(Role::user(ID::custom('notme'))),
],
'permissions' => [
Permission::read(Role::user(ID::custom('notme'))),
],
]);
$this->assertEquals($file['headers']['status-code'], 400);
$this->assertEquals(401, $file['headers']['status-code']);
$this->assertStringStartsWith('Permissions must be one of:', $file['body']['message']);
$this->assertStringContainsString('any', $file['body']['message']);
$this->assertStringContainsString('users', $file['body']['message']);
@ -257,7 +257,7 @@ class StorageCustomClientTest extends Scope
]
]);
$this->assertEquals($file['headers']['status-code'], 400);
$this->assertEquals(401, $file['headers']['status-code']);
$this->assertStringStartsWith('Permissions must be one of:', $file['body']['message']);
$this->assertStringContainsString('any', $file['body']['message']);
$this->assertStringContainsString('users', $file['body']['message']);
@ -275,7 +275,7 @@ class StorageCustomClientTest extends Scope
],
]);
$this->assertEquals($file['headers']['status-code'], 400);
$this->assertEquals(401, $file['headers']['status-code']);
$this->assertStringStartsWith('Permissions must be one of:', $file['body']['message']);
$this->assertStringContainsString('any', $file['body']['message']);
$this->assertStringContainsString('users', $file['body']['message']);