diff options
author | Vitor Mattos <vitor@php.rio> | 2021-09-15 17:39:43 +0300 |
---|---|---|
committer | Vitor Mattos <vitor@php.rio> | 2021-09-15 18:35:32 +0300 |
commit | 5b2499fbf06f8aca982f51b448d620db0b35dc52 (patch) | |
tree | 12a8e93bf0e84cb60b1d6e602ee87d208df83174 /tests | |
parent | 4a0129607aaa132f4f5c9e89e5c5d71cc45c853e (diff) |
Fixes to remove warnings when use phpunit 9.5.6
Replace method at by withConsecutive and use a condition to prevent
error when not has expected message
Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/php/Chat/SystemMessage/ListenerTest.php | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/tests/php/Chat/SystemMessage/ListenerTest.php b/tests/php/Chat/SystemMessage/ListenerTest.php index 62e93bd19..79bb4109e 100644 --- a/tests/php/Chat/SystemMessage/ListenerTest.php +++ b/tests/php/Chat/SystemMessage/ListenerTest.php @@ -298,18 +298,21 @@ class ListenerTest extends TestCase { $event = new ModifyParticipantEvent($room, $participant, '', $newParticipantType, $oldParticipantType); - foreach ($expectedMessages as $index => $expectedMessage) { - $this->chatManager->expects($this->at($index)) + foreach ($expectedMessages as $expectedMessage) { + $consecutive[] = [ + $room, + Attendee::ACTOR_USERS, + 'alice_actor', + json_encode($expectedMessage), + $this->dummyTime, + false, + self::DUMMY_REFERENCE_ID + ]; + } + if (isset($consecutive)) { + $this->chatManager->expects($this->once()) ->method('addSystemMessage') - ->with( - $room, - Attendee::ACTOR_USERS, - 'alice_actor', - json_encode($expectedMessage), - $this->dummyTime, - false, - self::DUMMY_REFERENCE_ID, - ); + ->withConsecutive(...$consecutive); } $this->dispatch(Room::EVENT_AFTER_PARTICIPANT_TYPE_SET, $event); |