diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/features/callapi/recording.feature | 12 | ||||
-rw-r--r-- | tests/php/Chat/SystemMessage/ListenerTest.php | 117 |
2 files changed, 105 insertions, 24 deletions
diff --git a/tests/integration/features/callapi/recording.feature b/tests/integration/features/callapi/recording.feature index eff03accd..0755a7129 100644 --- a/tests/integration/features/callapi/recording.feature +++ b/tests/integration/features/callapi/recording.feature @@ -18,7 +18,7 @@ Feature: callapi/recording | room1 | {"type":"start","start":{"status":1,"owner":"participant1","actor":{"type":"users","id":"participant1"}}} | And user "participant1" is participant of the following unordered rooms (v4) | type | name | callRecording | - | 2 | room1 | 0 | + | 2 | room1 | 3 | And recording server sent started request for "video" recording in room "room1" as "participant1" with 200 Then user "participant1" sees the following system messages in room "room1" with 200 (v1) | room | actorType | actorId | actorDisplayName | systemMessage | @@ -61,7 +61,7 @@ Feature: callapi/recording | room1 | {"type":"start","start":{"status":2,"owner":"participant1","actor":{"type":"users","id":"participant1"}}} | And user "participant1" is participant of the following unordered rooms (v4) | type | name | callRecording | - | 2 | room1 | 0 | + | 2 | room1 | 4 | And recording server sent started request for "audio" recording in room "room1" as "participant1" with 200 Then user "participant1" sees the following system messages in room "room1" with 200 (v1) | room | actorType | actorId | actorDisplayName | systemMessage | @@ -102,10 +102,6 @@ Feature: callapi/recording And recording server received the following requests | token | data | | room1 | {"type":"start","start":{"status":2,"owner":"participant1","actor":{"type":"users","id":"participant1"}}} | - And user "participant1" starts "audio" recording in room "room1" with 200 (v1) - And recording server received the following requests - | token | data | - | room1 | {"type":"start","start":{"status":2,"owner":"participant1","actor":{"type":"users","id":"participant1"}}} | And recording server sent started request for "audio" recording in room "room1" as "participant1" with 200 And user "participant1" starts "audio" recording in room "room1" with 400 (v1) Then the response error matches with "recording" @@ -131,10 +127,6 @@ Feature: callapi/recording And recording server received the following requests | token | data | | room1 | {"type":"start","start":{"status":1,"owner":"participant1","actor":{"type":"users","id":"participant1"}}} | - And user "participant1" starts "video" recording in room "room1" with 200 (v1) - And recording server received the following requests - | token | data | - | room1 | {"type":"start","start":{"status":1,"owner":"participant1","actor":{"type":"users","id":"participant1"}}} | And recording server sent started request for "video" recording in room "room1" as "participant1" with 200 And user "participant1" starts "video" recording in room "room1" with 400 (v1) Then the response error matches with "recording" diff --git a/tests/php/Chat/SystemMessage/ListenerTest.php b/tests/php/Chat/SystemMessage/ListenerTest.php index 3e073a244..91dd198ae 100644 --- a/tests/php/Chat/SystemMessage/ListenerTest.php +++ b/tests/php/Chat/SystemMessage/ListenerTest.php @@ -322,6 +322,34 @@ class ListenerTest extends TestCase { public function callRecordingChangeProvider() { return [ [ + Room::RECORDING_VIDEO_STARTING, + Room::RECORDING_NONE, + null, + null, + null, + ], + [ + Room::RECORDING_VIDEO_STARTING, + Room::RECORDING_NONE, + Attendee::ACTOR_USERS, + 'alice', + null, + ], + [ + Room::RECORDING_VIDEO, + Room::RECORDING_VIDEO_STARTING, + null, + null, + ['message' => 'recording_started', 'parameters' => []], + ], + [ + Room::RECORDING_VIDEO, + Room::RECORDING_VIDEO_STARTING, + Attendee::ACTOR_USERS, + 'alice', + ['message' => 'recording_started', 'parameters' => []], + ], + [ Room::RECORDING_VIDEO, Room::RECORDING_NONE, null, @@ -336,6 +364,34 @@ class ListenerTest extends TestCase { ['message' => 'recording_started', 'parameters' => []], ], [ + Room::RECORDING_AUDIO_STARTING, + Room::RECORDING_NONE, + null, + null, + null, + ], + [ + Room::RECORDING_AUDIO_STARTING, + Room::RECORDING_NONE, + Attendee::ACTOR_USERS, + 'alice', + null, + ], + [ + Room::RECORDING_AUDIO, + Room::RECORDING_AUDIO_STARTING, + null, + null, + ['message' => 'audio_recording_started', 'parameters' => []], + ], + [ + Room::RECORDING_AUDIO, + Room::RECORDING_AUDIO_STARTING, + Attendee::ACTOR_USERS, + 'alice', + ['message' => 'audio_recording_started', 'parameters' => []], + ], + [ Room::RECORDING_AUDIO, Room::RECORDING_NONE, null, @@ -351,6 +407,20 @@ class ListenerTest extends TestCase { ], [ Room::RECORDING_NONE, + Room::RECORDING_VIDEO_STARTING, + null, + null, + null, + ], + [ + Room::RECORDING_NONE, + Room::RECORDING_VIDEO_STARTING, + Attendee::ACTOR_USERS, + 'bob', + null, + ], + [ + Room::RECORDING_NONE, Room::RECORDING_VIDEO, null, null, @@ -365,6 +435,20 @@ class ListenerTest extends TestCase { ], [ Room::RECORDING_NONE, + Room::RECORDING_AUDIO_STARTING, + null, + null, + null, + ], + [ + Room::RECORDING_NONE, + Room::RECORDING_AUDIO_STARTING, + Attendee::ACTOR_USERS, + 'bob', + null, + ], + [ + Room::RECORDING_NONE, Room::RECORDING_AUDIO, null, null, @@ -389,7 +473,7 @@ class ListenerTest extends TestCase { * @param string|null $actorId * @param array $expectedMessage */ - public function testAfterCallRecordingSet(int $newStatus, int $oldStatus, ?string $actorType, ?string $actorId, array $expectedMessage): void { + public function testAfterCallRecordingSet(int $newStatus, int $oldStatus, ?string $actorType, ?string $actorId, ?array $expectedMessage): void { $this->mockLoggedInUser('logged_in_user'); $room = $this->createMock(Room::class); @@ -416,19 +500,24 @@ class ListenerTest extends TestCase { $event = new ModifyRoomEvent($room, 'callRecording', $newStatus, $oldStatus, $participant); - $this->chatManager->expects($this->once()) - ->method('addSystemMessage') - ->with( - $room, - $expectedActorType, - $expectedActorId, - json_encode($expectedMessage), - $this->dummyTime, - false, - SELF::DUMMY_REFERENCE_ID, - null, - false - ); + if ($expectedMessage !== null) { + $this->chatManager->expects($this->once()) + ->method('addSystemMessage') + ->with( + $room, + $expectedActorType, + $expectedActorId, + json_encode($expectedMessage), + $this->dummyTime, + false, + SELF::DUMMY_REFERENCE_ID, + null, + false + ); + } else { + $this->chatManager->expects($this->never()) + ->method('addSystemMessage'); + } $this->dispatch(Room::EVENT_AFTER_SET_CALL_RECORDING, $event); } |