fix storage test
This commit is contained in:
parent
625201a1c2
commit
f3c358f24a
|
@ -851,7 +851,7 @@ class RealtimeCustomClientTest extends Scope
|
|||
$session = $user['session'] ?? '';
|
||||
$projectId = $this->getProject()['$id'];
|
||||
|
||||
$client = $this->getWebsocket(['files', 'buckets'], [
|
||||
$client = $this->getWebsocket(['files'], [
|
||||
'origin' => 'http://localhost',
|
||||
'cookie' => 'a_session_'.$projectId.'=' . $session
|
||||
]);
|
||||
|
@ -863,7 +863,6 @@ class RealtimeCustomClientTest extends Scope
|
|||
$this->assertNotEmpty($response['data']);
|
||||
$this->assertCount(2, $response['data']['channels']);
|
||||
$this->assertContains('files', $response['data']['channels']);
|
||||
$this->assertContains('buckets', $response['data']['channels']);
|
||||
$this->assertNotEmpty($response['data']['user']);
|
||||
$this->assertEquals($user['$id'], $response['data']['user']['$id']);
|
||||
|
||||
|
@ -881,18 +880,7 @@ class RealtimeCustomClientTest extends Scope
|
|||
'write' => ['role:all'],
|
||||
'permission' => 'bucket'
|
||||
]);
|
||||
$response = json_decode($client->receive(), true);
|
||||
|
||||
$this->assertArrayHasKey('type', $response);
|
||||
$this->assertArrayHasKey('data', $response);
|
||||
$this->assertEquals('event', $response['type']);
|
||||
$this->assertNotEmpty($response['data']);
|
||||
$this->assertArrayHasKey('timestamp', $response['data']);
|
||||
$this->assertCount(2, $response['data']['channels']);
|
||||
$this->assertContains('buckets', $response['data']['channels']);
|
||||
$this->assertContains('buckets.' . $bucket1['body']['$id'], $response['data']['channels']);
|
||||
$this->assertEquals('storage.buckets.create', $response['data']['event']);
|
||||
$this->assertNotEmpty($response['data']['payload']);
|
||||
$data = ['bucketId' => $bucket1['body']['$id']];
|
||||
/**
|
||||
* Test File Create
|
||||
|
@ -944,7 +932,7 @@ class RealtimeCustomClientTest extends Scope
|
|||
$this->assertArrayHasKey('timestamp', $response['data']);
|
||||
$this->assertCount(3, $response['data']['channels']);
|
||||
$this->assertContains('files', $response['data']['channels']);
|
||||
$this->assertContains('files.' . $file['body']['$id'], $response['data']['channels']);
|
||||
$this->assertContains('buckets.' . $data['bucketId'] . '.files.' . $file['body']['$id'], $response['data']['channels']);
|
||||
$this->assertContains('buckets.' . $data['bucketId'] . '.files', $response['data']['channels']);
|
||||
$this->assertEquals('storage.files.update', $response['data']['event']);
|
||||
$this->assertNotEmpty($response['data']['payload']);
|
||||
|
@ -966,7 +954,7 @@ class RealtimeCustomClientTest extends Scope
|
|||
$this->assertArrayHasKey('timestamp', $response['data']);
|
||||
$this->assertCount(3, $response['data']['channels']);
|
||||
$this->assertContains('files', $response['data']['channels']);
|
||||
$this->assertContains('files.' . $file['body']['$id'], $response['data']['channels']);
|
||||
$this->assertContains('buckets.' . $data['bucketId'] . '.files.' . $file['body']['$id'], $response['data']['channels']);
|
||||
$this->assertContains('buckets.' . $data['bucketId'] . '.files', $response['data']['channels']);
|
||||
$this->assertEquals('storage.files.delete', $response['data']['event']);
|
||||
$this->assertNotEmpty($response['data']['payload']);
|
||||
|
|
Loading…
Reference in a new issue