From 1af33d1af74b33ea34a5527f32335c0738eab733 Mon Sep 17 00:00:00 2001 From: fogelito Date: Wed, 29 Mar 2023 18:34:49 +0300 Subject: [PATCH] related attributes call tests --- tests/e2e/Services/Databases/DatabasesBase.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 2fe8103b35..a51124c9d7 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -3423,6 +3423,24 @@ trait DatabasesBase sleep(1); + $libraryAttributesResponse = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $libraryCollection . '/attributes', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertIsArray($libraryAttributesResponse['body']['attributes']); + $this->assertEquals(2, $libraryAttributesResponse['body']['total']); + + $libraryCollectionResponse = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $libraryCollection, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertIsArray($libraryCollectionResponse['body']['attributes']); + $this->assertCount(2, $libraryCollectionResponse['body']['attributes']); + $attribute = $this->client->call(Client::METHOD_GET, "/databases/{$databaseId}/collections/{$personCollection}/attributes/libraries", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'],