File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
src/Protocols/Pusher/Managers
tests/Unit/Protocols/Pusher Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ public function channels(?string $channel = null): Channel|array|null
134134 {
135135 $ channels = $ this ->applications [$ this ->application ->id ()] ?? [];
136136
137- if ($ channel ) {
137+ if (isset ( $ channel) ) {
138138 return $ channels [$ channel ] ?? null ;
139139 }
140140
Original file line number Diff line number Diff line change 3838 ]);
3939});
4040
41+ it ('can subscribe to an empty channel ' , function () {
42+ $ this ->pusher ->handle (
43+ $ this ->connection ,
44+ 'pusher:subscribe ' ,
45+ ['channel ' => '' ]
46+ );
47+
48+ $ this ->connection ->assertReceived ([
49+ 'event ' => 'pusher_internal:subscription_succeeded ' ,
50+ 'data ' => '{} ' ,
51+ ]);
52+ });
53+
4154it ('can unsubscribe from a channel ' , function () {
4255 $ this ->pusher ->handle (
4356 $ this ->connection ,
You can’t perform that action at this time.
0 commit comments