diff --git a/tests/Feature/Protocols/Pusher/Reverb/EventsBatchControllerTest.php b/tests/Feature/Protocols/Pusher/Reverb/EventsBatchControllerTest.php index 5b6b1868..b5a2e862 100644 --- a/tests/Feature/Protocols/Pusher/Reverb/EventsBatchControllerTest.php +++ b/tests/Feature/Protocols/Pusher/Reverb/EventsBatchControllerTest.php @@ -119,7 +119,7 @@ it('can receive an event batch trigger with multiple events and gather info for some', function () { $this->usingRedis(); - + subscribe('presence-test-channel'); $response = await($this->signedPostRequest('batch_events', ['batch' => [ [ diff --git a/tests/Feature/Protocols/Pusher/Reverb/EventsControllerTest.php b/tests/Feature/Protocols/Pusher/Reverb/EventsControllerTest.php index 9c8f68b7..5d660ec2 100644 --- a/tests/Feature/Protocols/Pusher/Reverb/EventsControllerTest.php +++ b/tests/Feature/Protocols/Pusher/Reverb/EventsControllerTest.php @@ -113,34 +113,34 @@ ], ]); - it('can gather user counts when requested', function () { - $this->usingRedis(); - - subscribe('presence-test-channel-one'); - - $response = await($this->signedPostRequest('events', [ - 'name' => 'NewEvent', - 'channels' => ['presence-test-channel-one', 'test-channel-two'], - 'data' => json_encode(['some' => 'data']), - 'info' => 'user_count', - ])); - - expect($response->getStatusCode())->toBe(200); - expect($response->getBody()->getContents())->toBe('{"channels":{"presence-test-channel-one":{"user_count":1},"test-channel-two":{}}}'); - }); - - it('can gather subscription counts when requested', function () { - $this->usingRedis(); - - subscribe('test-channel-two'); - - $response = await($this->signedPostRequest('events', [ - 'name' => 'NewEvent', - 'channels' => ['presence-test-channel-one', 'test-channel-two'], - 'data' => json_encode(['some' => 'data']), - 'info' => 'subscription_count', - ])); - - expect($response->getStatusCode())->toBe(200); - expect($response->getBody()->getContents())->toBe('{"channels":{"presence-test-channel-one":{},"test-channel-two":{"subscription_count":1}}}'); - }); +it('can gather user counts when requested', function () { + $this->usingRedis(); + + subscribe('presence-test-channel-one'); + + $response = await($this->signedPostRequest('events', [ + 'name' => 'NewEvent', + 'channels' => ['presence-test-channel-one', 'test-channel-two'], + 'data' => json_encode(['some' => 'data']), + 'info' => 'user_count', + ])); + + expect($response->getStatusCode())->toBe(200); + expect($response->getBody()->getContents())->toBe('{"channels":{"presence-test-channel-one":{"user_count":1},"test-channel-two":{}}}'); +}); + +it('can gather subscription counts when requested', function () { + $this->usingRedis(); + + subscribe('test-channel-two'); + + $response = await($this->signedPostRequest('events', [ + 'name' => 'NewEvent', + 'channels' => ['presence-test-channel-one', 'test-channel-two'], + 'data' => json_encode(['some' => 'data']), + 'info' => 'subscription_count', + ])); + + expect($response->getStatusCode())->toBe(200); + expect($response->getBody()->getContents())->toBe('{"channels":{"presence-test-channel-one":{},"test-channel-two":{"subscription_count":1}}}'); +});