Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2019-08-07 12:58:52 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2019-08-21 14:54:35 +0300
commitacf5faf46c929a6a6d2c8ae9c19df2a7ebc89548 (patch)
treed575e85d8fee0ff4a9e143f9fce215e6678a0a5c /tests
parent78dde5240afa7010a73ba62aec059c6f1b4fe0e6 (diff)
Fix missing notifications to signaling backend for some room events
The signaling backend was not notified when the password, type or read only state of the room was modified so, in turn, the signaling backend did not notify the clients about those changes. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/php/Signaling/BackendNotifierTest.php63
1 files changed, 63 insertions, 0 deletions
diff --git a/tests/php/Signaling/BackendNotifierTest.php b/tests/php/Signaling/BackendNotifierTest.php
index 40050410e..078b8f8a0 100644
--- a/tests/php/Signaling/BackendNotifierTest.php
+++ b/tests/php/Signaling/BackendNotifierTest.php
@@ -255,6 +255,69 @@ class BackendNotifierTest extends \Test\TestCase {
], $bodies);
}
+ public function testRoomPasswordChanged() {
+ $room = $this->manager->createPublicRoom();
+ $room->setPassword('password');
+
+ $requests = $this->controller->getRequests();
+ $bodies = array_map(function($request) use ($room) {
+ return json_decode($this->validateBackendRequest($this->baseUrl . '/api/v1/room/' . $room->getToken(), $request), true);
+ }, $requests);
+ $this->assertContains([
+ 'type' => 'update',
+ 'update' => [
+ 'userids' => [
+ ],
+ 'properties' => [
+ 'name' => $room->getDisplayName(''),
+ 'type' => $room->getType(),
+ ],
+ ],
+ ], $bodies);
+ }
+
+ public function testRoomTypeChanged() {
+ $room = $this->manager->createPublicRoom();
+ $room->changeType(Room::GROUP_CALL);
+
+ $requests = $this->controller->getRequests();
+ $bodies = array_map(function($request) use ($room) {
+ return json_decode($this->validateBackendRequest($this->baseUrl . '/api/v1/room/' . $room->getToken(), $request), true);
+ }, $requests);
+ $this->assertContains([
+ 'type' => 'update',
+ 'update' => [
+ 'userids' => [
+ ],
+ 'properties' => [
+ 'name' => $room->getDisplayName(''),
+ 'type' => $room->getType(),
+ ],
+ ],
+ ], $bodies);
+ }
+
+ public function testRoomReadOnlyChanged() {
+ $room = $this->manager->createPublicRoom();
+ $room->setReadOnly(Room::READ_ONLY);
+
+ $requests = $this->controller->getRequests();
+ $bodies = array_map(function($request) use ($room) {
+ return json_decode($this->validateBackendRequest($this->baseUrl . '/api/v1/room/' . $room->getToken(), $request), true);
+ }, $requests);
+ $this->assertContains([
+ 'type' => 'update',
+ 'update' => [
+ 'userids' => [
+ ],
+ 'properties' => [
+ 'name' => $room->getDisplayName(''),
+ 'type' => $room->getType(),
+ ],
+ ],
+ ], $bodies);
+ }
+
public function testRoomDelete() {
$room = $this->manager->createPublicRoom();
$room->addUsers([