From c8a8f4650e8e73d2a1edf54531a408602f569764 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 11 Jul 2020 19:24:18 +0300 Subject: [PATCH] Updated test to make sure permission updating bug is not happening again --- tests/e2e/Services/Database/DatabaseBase.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index 7e68940104..f769184827 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -415,8 +415,8 @@ trait DatabaseBase 'name' => 'Thor: Ragnaroc', 'releaseYear' => 2017, ], - 'read' => ['user:'.$this->getUser()['$id']], - 'write' => ['user:'.$this->getUser()['$id']], + 'read' => ['user:'.$this->getUser()['$id'], 'testx'], + 'write' => ['user:'.$this->getUser()['$id'], 'testy'], ]); $id = $document['body']['$id']; @@ -425,6 +425,8 @@ trait DatabaseBase $this->assertEquals($document['headers']['status-code'], 201); $this->assertEquals($document['body']['name'], 'Thor: Ragnaroc'); $this->assertEquals($document['body']['releaseYear'], 2017); + $this->assertEquals($document['body']['$permissions']['read'][1], 'testx'); + $this->assertEquals($document['body']['$permissions']['write'][1], 'testy'); $document = $this->client->call(Client::METHOD_PATCH, '/database/collections/' . $collection . '/documents/' . $id, array_merge([ 'content-type' => 'application/json',