This commit is contained in:
Alex Bouma 2020-09-15 16:12:25 +02:00
parent 9da68ecd40
commit 5024a2a05a
No known key found for this signature in database
GPG Key ID: AC101F160BEBEA17
1 changed files with 4 additions and 4 deletions

View File

@ -90,9 +90,9 @@ class PresenceChannelTest extends TestCase
'channel' => $channelName, 'channel' => $channelName,
'data' => json_encode([ 'data' => json_encode([
'presence' => [ 'presence' => [
'ids' => [(string)$userId], 'ids' => [(string) $userId],
'hash' => [ 'hash' => [
(string)$userId => [], (string) $userId => [],
], ],
'count' => 1, 'count' => 1,
], ],
@ -102,12 +102,12 @@ class PresenceChannelTest extends TestCase
private function getSignedMessage(Connection $connection, string $channelName, array $channelData): Message private function getSignedMessage(Connection $connection, string $channelName, array $channelData): Message
{ {
$signature = "{$connection->socketId}:{$channelName}:" . json_encode($channelData); $signature = "{$connection->socketId}:{$channelName}:".json_encode($channelData);
return new Message(json_encode([ return new Message(json_encode([
'event' => 'pusher:subscribe', 'event' => 'pusher:subscribe',
'data' => [ 'data' => [
'auth' => $connection->app->key . ':' . hash_hmac('sha256', $signature, $connection->app->secret), 'auth' => $connection->app->key.':'.hash_hmac('sha256', $signature, $connection->app->secret),
'channel' => $channelName, 'channel' => $channelName,
'channel_data' => json_encode($channelData), 'channel_data' => json_encode($channelData),
], ],