summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2022-12-19 01:41:30 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2023-01-31 04:58:04 +0100
commitad21f0325288731f2eac3a45fc2c32b60bea6ed5 (patch)
treeaa4dfbc9269e0437f9b8f73aa8339ae901c72402 /tests
parent49705254cf38f838d06d94b2eac5f58bc78d74a1 (diff)
Ignore messages in other rooms when asserting that a message was sent
When asserting that a message was sent to the signaling server all the requests were validated before looking for the expected one. As the requests include the token of the room all the requests were expected to be sent to the same room; otherwise any request sent to other room would make the assert fail. Now the requests to other rooms than the room of the actual message being asserted are ignored, which will make possible to sent messages to different rooms in the same test. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/php/Signaling/BackendNotifierTest.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/php/Signaling/BackendNotifierTest.php b/tests/php/Signaling/BackendNotifierTest.php
index a711fcf44..3a649cc5a 100644
--- a/tests/php/Signaling/BackendNotifierTest.php
+++ b/tests/php/Signaling/BackendNotifierTest.php
@@ -211,6 +211,9 @@ class BackendNotifierTest extends TestCase {
$expectedUrl = $this->baseUrl . '/api/v1/room/' . $room->getToken();
$requests = $this->controller->getRequests();
+ $requests = array_filter($requests, function ($request) use ($expectedUrl) {
+ return $request['url'] === $expectedUrl;
+ });
$bodies = array_map(function ($request) use ($expectedUrl) {
return json_decode($this->validateBackendRequest($expectedUrl, $request), true);
}, $requests);