diff options
author | Joas Schilling <coding@schilljs.com> | 2021-09-27 17:54:29 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-10-07 19:18:31 +0300 |
commit | e115e96d7daa11b70fb270f59825894535f10c7c (patch) | |
tree | 6b9c78e0325c0a33106ea2b3cc1aa6b5e20697fa /tests | |
parent | 1c641f8c64a80753fc46ec27e622c696f1f93fc8 (diff) |
Remove moderator option and clear custom permissions when setting the conversation permissions
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/php/Model/AttendeeMapperTest.php | 89 |
1 files changed, 7 insertions, 82 deletions
diff --git a/tests/php/Model/AttendeeMapperTest.php b/tests/php/Model/AttendeeMapperTest.php index 602b317d6..33d27fb64 100644 --- a/tests/php/Model/AttendeeMapperTest.php +++ b/tests/php/Model/AttendeeMapperTest.php @@ -83,7 +83,6 @@ class AttendeeMapperTest extends TestCase { ], Participant::PERMISSIONS_MODIFY_SET, Attendee::PERMISSIONS_CALL_START, - false, [ [ 'actor_type' => Attendee::ACTOR_CIRCLES, @@ -120,75 +119,6 @@ class AttendeeMapperTest extends TestCase { 1 => [ [ [ - 'actor_type' => Attendee::ACTOR_CIRCLES, - 'actor_id' => 'c1', - 'participant_type' => Participant::USER, - 'permissions' => Attendee::PERMISSIONS_CUSTOM, - ], - [ - 'actor_type' => Attendee::ACTOR_GROUPS, - 'actor_id' => 'g1', - 'participant_type' => Participant::USER, - 'permissions' => Attendee::PERMISSIONS_CUSTOM, - ], - [ - 'actor_type' => Attendee::ACTOR_USERS, - 'actor_id' => 'o1', - 'participant_type' => Participant::OWNER, - 'permissions' => Attendee::PERMISSIONS_CUSTOM, - ], - [ - 'actor_type' => Attendee::ACTOR_USERS, - 'actor_id' => 'm1', - 'participant_type' => Participant::MODERATOR, - 'permissions' => Attendee::PERMISSIONS_CUSTOM, - ], - [ - 'actor_type' => Attendee::ACTOR_USERS, - 'actor_id' => 'u1', - 'participant_type' => Participant::USER, - 'permissions' => Attendee::PERMISSIONS_CUSTOM, - ], - ], - Participant::PERMISSIONS_MODIFY_SET, - Attendee::PERMISSIONS_CALL_START, - true, - [ - [ - 'actor_type' => Attendee::ACTOR_CIRCLES, - 'actor_id' => 'c1', - 'participant_type' => Participant::USER, - 'permissions' => Attendee::PERMISSIONS_CUSTOM, - ], - [ - 'actor_type' => Attendee::ACTOR_GROUPS, - 'actor_id' => 'g1', - 'participant_type' => Participant::USER, - 'permissions' => Attendee::PERMISSIONS_CUSTOM, - ], - [ - 'actor_type' => Attendee::ACTOR_USERS, - 'actor_id' => 'o1', - 'participant_type' => Participant::OWNER, - 'permissions' => Attendee::PERMISSIONS_CUSTOM + Attendee::PERMISSIONS_CALL_START, - ], - [ - 'actor_type' => Attendee::ACTOR_USERS, - 'actor_id' => 'm1', - 'participant_type' => Participant::MODERATOR, - 'permissions' => Attendee::PERMISSIONS_CUSTOM + Attendee::PERMISSIONS_CALL_START, - ], - [ - 'actor_type' => Attendee::ACTOR_USERS, - 'actor_id' => 'u1', - 'participant_type' => Participant::USER, - 'permissions' => Attendee::PERMISSIONS_CUSTOM + Attendee::PERMISSIONS_CALL_START, - ], - ], - ], - 2 => [ - [ - [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'o1', 'participant_type' => Participant::OWNER, @@ -209,19 +139,18 @@ class AttendeeMapperTest extends TestCase { ], Participant::PERMISSIONS_MODIFY_SET, Attendee::PERMISSIONS_CALL_START, - false, [ [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'o1', 'participant_type' => Participant::OWNER, - 'permissions' => Attendee::PERMISSIONS_CUSTOM + Attendee::PERMISSIONS_PUBLISH_AUDIO + Attendee::PERMISSIONS_PUBLISH_VIDEO, + 'permissions' => Attendee::PERMISSIONS_CUSTOM + Attendee::PERMISSIONS_CALL_START, ], [ 'actor_type' => Attendee::ACTOR_USERS, 'actor_id' => 'm1', 'participant_type' => Participant::MODERATOR, - 'permissions' => Attendee::PERMISSIONS_CUSTOM + Attendee::PERMISSIONS_PUBLISH_AUDIO + Attendee::PERMISSIONS_PUBLISH_VIDEO, + 'permissions' => Attendee::PERMISSIONS_CUSTOM + Attendee::PERMISSIONS_CALL_START, ], [ 'actor_type' => Attendee::ACTOR_USERS, @@ -231,7 +160,7 @@ class AttendeeMapperTest extends TestCase { ], ], ], - 3 => [ + 2 => [ [ [ 'actor_type' => Attendee::ACTOR_USERS, @@ -254,7 +183,6 @@ class AttendeeMapperTest extends TestCase { ], Participant::PERMISSIONS_MODIFY_SET, Attendee::PERMISSIONS_CALL_START, - true, [ [ 'actor_type' => Attendee::ACTOR_USERS, @@ -276,7 +204,7 @@ class AttendeeMapperTest extends TestCase { ], ], ], - 4 => [ + 3 => [ [ [ 'actor_type' => Attendee::ACTOR_USERS, @@ -305,7 +233,6 @@ class AttendeeMapperTest extends TestCase { ], Participant::PERMISSIONS_MODIFY_ADD, Attendee::PERMISSIONS_CALL_START, - true, [ [ 'actor_type' => Attendee::ACTOR_USERS, @@ -333,7 +260,7 @@ class AttendeeMapperTest extends TestCase { ], ], ], - 5 => [ + 4 => [ [ [ 'actor_type' => Attendee::ACTOR_USERS, @@ -368,7 +295,6 @@ class AttendeeMapperTest extends TestCase { ], Participant::PERMISSIONS_MODIFY_REMOVE, Attendee::PERMISSIONS_CALL_START, - true, [ [ 'actor_type' => Attendee::ACTOR_USERS, @@ -410,10 +336,9 @@ class AttendeeMapperTest extends TestCase { * @param array $attendees * @param string $mode * @param int $permission - * @param bool $includeModerators * @param array $expected */ - public function testModifyPermissions(array $attendees, string $mode, int $permission, bool $includeModerators, array $expected): void { + public function testModifyPermissions(array $attendees, string $mode, int $permission, array $expected): void { $roomId = 12345678; foreach ($attendees as $attendeeData) { @@ -432,7 +357,7 @@ class AttendeeMapperTest extends TestCase { $this->attendeeMapper->insert($attendee); } - $this->attendeeMapper->modifyPermissions($roomId, $mode, $permission, $includeModerators); + $this->attendeeMapper->modifyPermissions($roomId, $mode, $permission); foreach ($expected as $attendeeData) { $attendee = $this->attendeeMapper->findByActor($roomId, $attendeeData['actor_type'], $attendeeData['actor_id']); |