This repository was archived by the owner on Feb 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,6 @@ public function respond()
4242
4343 $ channel = $ this ->channelManager ->find ($ this ->connection ->app ->id , $ this ->payload ->channel );
4444
45- optional ($ channel )->broadcast ( $ this ->payload );
45+ optional ($ channel )->broadcastToOthers ( $ this -> connection , $ this ->payload );
4646 }
4747}
Original file line number Diff line number Diff line change @@ -39,7 +39,8 @@ public function client_messages_get_broadcasted_when_enabled()
3939 ],
4040 ]);
4141
42- $ connection = $ this ->getConnectedWebSocketConnection (['test-channel ' ]);
42+ $ connection1 = $ this ->getConnectedWebSocketConnection (['test-channel ' ]);
43+ $ connection2 = $ this ->getConnectedWebSocketConnection (['test-channel ' ]);
4344
4445 $ message = new Message (json_encode ([
4546 'event ' => 'client-test ' ,
@@ -49,9 +50,11 @@ public function client_messages_get_broadcasted_when_enabled()
4950 ],
5051 ]));
5152
52- $ this ->pusherServer ->onMessage ($ connection , $ message );
53+ $ this ->pusherServer ->onMessage ($ connection1 , $ message );
54+
55+ $ connection1 ->assertNotSentEvent ('client-test ' );
5356
54- $ connection ->assertSentEvent ('client-test ' , [
57+ $ connection2 ->assertSentEvent ('client-test ' , [
5558 'data ' => [
5659 'client-event ' => 'test '
5760 ]
You can’t perform that action at this time.
0 commit comments