diff --git a/tests/Feature/Protocols/Pusher/Reverb/ConnectionsControllerTest.php b/tests/Feature/Protocols/Pusher/Reverb/ConnectionsControllerTest.php new file mode 100644 index 00000000..ddb54739 --- /dev/null +++ b/tests/Feature/Protocols/Pusher/Reverb/ConnectionsControllerTest.php @@ -0,0 +1,28 @@ +signedRequest('connections')); + + expect($response->getStatusCode())->toBe(200); + expect($response->getBody()->getContents())->toBe('{"connections":2}'); +}); + +it('can return the correct connection count when subscribed to multiple channels', function () { + $connection = connect(); + subscribe('test-channel-one', connection: $connection); + subscribe('presence-test-channel-two', connection: $connection); + + $response = await($this->signedRequest('connections')); + + expect($response->getStatusCode())->toBe(200); + expect($response->getBody()->getContents())->toBe('{"connections":1}'); +});