diff --git a/tests/e2e/Scopes/SideConsole.php b/tests/e2e/Scopes/SideConsole.php new file mode 100644 index 000000000..005f2b698 --- /dev/null +++ b/tests/e2e/Scopes/SideConsole.php @@ -0,0 +1,22 @@ + 'http://localhost', + 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $this->getRoot()['session'], + ]; + } + + /** + * @return string + */ + public function getSide() + { + return 'console'; + } +} diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index 2df18dea2..9db5bc2db 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -17,16 +17,17 @@ trait StorageBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ + ], $this->getHeaders()), [ 'name' => 'Test Bucket', + 'read' => ['role:all'], + 'write' => ['role:all'], ]); - var_dump($bucket); $this->assertEquals(201, $bucket['headers']['status-code']); $this->assertNotEmpty($bucket['body']['$id']); $bucketId = $bucket['body']['$id']; - $file = $this->client->call(Client::METHOD_POST, '/storage/' . $bucketId .'/files', array_merge([ + $file = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucketId .'/files', array_merge([ 'content-type' => 'multipart/form-data', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -34,8 +35,7 @@ trait StorageBase 'read' => ['role:all'], 'write' => ['role:all'], ]); - - $this->assertEquals($file['headers']['status-code'], 201); + $this->assertEquals(201, $file['headers']['status-code']); $this->assertNotEmpty($file['body']['$id']); $this->assertIsInt($file['body']['dateCreated']); $this->assertEquals('logo.png', $file['body']['name']); diff --git a/tests/e2e/Services/Storage/StorageConsoleClientTest.php b/tests/e2e/Services/Storage/StorageConsoleClientTest.php index b2c958296..4d207d402 100644 --- a/tests/e2e/Services/Storage/StorageConsoleClientTest.php +++ b/tests/e2e/Services/Storage/StorageConsoleClientTest.php @@ -4,11 +4,11 @@ namespace Tests\E2E\Services\Storage; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectConsole; -use Tests\E2E\Scopes\SideClient; +use Tests\E2E\Scopes\SideConsole; class StorageConsoleClientTest extends Scope { use StorageBase; use ProjectConsole; - use SideClient; + use SideConsole; } \ No newline at end of file