From 18be424fc0e16feedf3da8fc0262e5819b1196f0 Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 27 Mar 2023 18:24:02 +0300 Subject: [PATCH] Test list attributes --- tests/e2e/Services/Databases/DatabasesBase.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index eacac29a4e..be1f8adbca 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -3274,6 +3274,21 @@ trait DatabasesBase $this->assertEquals('relationship', $relation['body']['type']); $this->assertEquals('processing', $relation['body']['status']); + $attributes = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $person['body']['$id'] . '/attributes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $attributes['headers']['status-code']); + $this->assertEquals(2, $attributes['body']['total']); + $attributes = $attributes['body']['attributes']; + $this->assertEquals('library', $attributes[1]['relatedCollection']); + $this->assertEquals('oneToOne', $attributes[1]['relationType']); + $this->assertEquals(false, $attributes[1]['twoWay']); + $this->assertEquals('person', $attributes[1]['twoWayKey']); + $this->assertEquals(Database::RELATION_MUTATE_CASCADE, $attributes[1]['onDelete']); + $attribute = $this->client->call(Client::METHOD_GET, "/databases/{$databaseId}/collections/{$person['body']['$id']}/attributes/library", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'],