Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
joedixon committed May 8, 2024
1 parent 146c2c3 commit c9b2663
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@
expect($response->getHeader('Content-Length'))->toBe(['40']);
});

// it('can gather data for a single channel', function () {
// $this->usingRedis();
it('can gather data for a single channel', function () {
$this->usingRedis();

// subscribe('test-channel-one');
// subscribe('test-channel-one');
subscribe('test-channel-one');
subscribe('test-channel-one');

// $response = await($this->signedRequest('channels/test-channel-one?info=user_count,subscription_count,cache'));
$response = await($this->signedRequest('channels/test-channel-one?info=user_count,subscription_count,cache'));

// expect($response->getStatusCode())->toBe(200);
// expect($response->getBody()->getContents())->toBe('{"occupied":true,"subscription_count":2}');
// });
expect($response->getStatusCode())->toBe(200);
expect($response->getBody()->getContents())->toBe('{"occupied":true,"subscription_count":2}');
});

it('gathers unoccupied when no connections', function () {
$this->usingRedis();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@
expect($response->getBody()->getContents())->toBe('{"connections":1}');
});

// it('can send the content-length header when gathering results', function () {
// $this->usingRedis();
it('can send the content-length header when gathering results', function () {
$this->usingRedis();

// subscribe('test-channel-one');
// subscribe('presence-test-channel-two');
subscribe('test-channel-one');
subscribe('presence-test-channel-two');

// $response = await($this->signedRequest('connections'));
$response = await($this->signedRequest('connections'));

// expect($response->getHeader('Content-Length'))->toBe(['17']);
// });
expect($response->getHeader('Content-Length'))->toBe(['17']);
});
4 changes: 2 additions & 2 deletions tests/ReverbTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function usingRedis(): void

app(PubSubProvider::class)->connect($this->loop);
app(PubSubProvider::class)->subscribe();
usleep(50_000);
usleep(100_000);
}

/**
Expand Down Expand Up @@ -108,7 +108,7 @@ public function stopServer(): void
{
app(PubSubProvider::class)->disconnect();

usleep(50_000);
usleep(100_000);

if ($this->server) {
$this->server->stop();
Expand Down

0 comments on commit c9b2663

Please sign in to comment.