From 6d235e753199c99b7a33d705da78bd535dc6ef2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sun, 11 Sep 2022 08:13:28 +0000 Subject: [PATCH] Fix after new db library version --- composer.lock | 2 +- src/Appwrite/Auth/Auth.php | 2 +- tests/unit/Auth/AuthTest.php | 12 ++++++------ tests/unit/Messaging/MessagingChannelsTest.php | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.lock b/composer.lock index 3046a0f04d..edbbf5c730 100644 --- a/composer.lock +++ b/composer.lock @@ -5393,5 +5393,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } diff --git a/src/Appwrite/Auth/Auth.php b/src/Appwrite/Auth/Auth.php index c290d19862..cd26281090 100644 --- a/src/Appwrite/Auth/Auth.php +++ b/src/Appwrite/Auth/Auth.php @@ -433,7 +433,7 @@ class Auth if (isset($node['$id']) && isset($node['teamId'])) { $roles[] = Role::team($node['teamId'])->toString(); - $roles[] = Role::member($node['$id'])->toString(); + $roles[] = Role::user($node['$id'])->toString(); if (isset($node['roles'])) { foreach ($node['roles'] as $nodeRole) { // Set all team roles diff --git a/tests/unit/Auth/AuthTest.php b/tests/unit/Auth/AuthTest.php index 1480fbb23f..65200ecdab 100644 --- a/tests/unit/Auth/AuthTest.php +++ b/tests/unit/Auth/AuthTest.php @@ -382,8 +382,8 @@ class AuthTest extends TestCase $this->assertContains(Role::team(ID::custom('abc'), 'moderator')->toString(), $roles); $this->assertContains(Role::team(ID::custom('def'))->toString(), $roles); $this->assertContains(Role::team(ID::custom('def'), 'guest')->toString(), $roles); - $this->assertContains(Role::member(ID::custom('456'))->toString(), $roles); - $this->assertContains(Role::member(ID::custom('abc'))->toString(), $roles); + $this->assertContains(Role::user(ID::custom('456'))->toString(), $roles); + $this->assertContains(Role::user(ID::custom('abc'))->toString(), $roles); } public function testPrivilegedUserRoles(): void @@ -422,8 +422,8 @@ class AuthTest extends TestCase $this->assertContains(Role::team(ID::custom('abc'), 'moderator')->toString(), $roles); $this->assertContains(Role::team(ID::custom('def'))->toString(), $roles); $this->assertContains(Role::team(ID::custom('def'), 'guest')->toString(), $roles); - $this->assertContains(Role::member(ID::custom('def'))->toString(), $roles); - $this->assertContains(Role::member(ID::custom('abc'))->toString(), $roles); + $this->assertContains(Role::user(ID::custom('def'))->toString(), $roles); + $this->assertContains(Role::user(ID::custom('abc'))->toString(), $roles); } public function testAppUserRoles(): void @@ -462,7 +462,7 @@ class AuthTest extends TestCase $this->assertContains(Role::team(ID::custom('abc'), 'moderator')->toString(), $roles); $this->assertContains(Role::team(ID::custom('def'))->toString(), $roles); $this->assertContains(Role::team(ID::custom('def'), 'guest')->toString(), $roles); - $this->assertContains(Role::member(ID::custom('def'))->toString(), $roles); - $this->assertContains(Role::member(ID::custom('abc'))->toString(), $roles); + $this->assertContains(Role::user(ID::custom('def'))->toString(), $roles); + $this->assertContains(Role::user(ID::custom('abc'))->toString(), $roles); } } diff --git a/tests/unit/Messaging/MessagingChannelsTest.php b/tests/unit/Messaging/MessagingChannelsTest.php index dd2ec04401..58213aed5f 100644 --- a/tests/unit/Messaging/MessagingChannelsTest.php +++ b/tests/unit/Messaging/MessagingChannelsTest.php @@ -260,7 +260,7 @@ class MessagingChannelsTest extends TestCase for ($i = 0; $i < $this->connectionsPerChannel; $i++) { $permissions[] = Role::team(ID::custom('team' . $i))->toString(); - $permissions[] = Role::member(ID::custom('member' . $i))->toString(); + $permissions[] = Role::user(ID::custom('member' . $i))->toString(); } $event = [ 'project' => '1', @@ -292,7 +292,7 @@ class MessagingChannelsTest extends TestCase $permissions = [ Role::team(ID::custom('team' . $index), $role)->toString(), - Role::member(ID::custom('member' . $index))->toString() + Role::user(ID::custom('member' . $index))->toString() ]; $event = [