Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 5838aca

Browse files
committed
Set up config for broadcasting
1 parent 14f54da commit 5838aca

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

tests/TestCase.php

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,31 @@ protected function getEnvironmentSetUp($app)
6666
'database' => env('REDIS_DB', '0'),
6767
]);
6868

69+
$replicationDriver = getenv('REPLICATION_DRIVER') ?: 'local';
70+
6971
$app['config']->set(
70-
'websockets.replication.driver',
71-
getenv('REPLICATION_DRIVER') ?: 'local'
72+
'websockets.replication.driver', $replicationDriver
7273
);
74+
75+
$app['config']->set(
76+
'broadcasting.connections.websockets', [
77+
'driver' => 'websockets',
78+
'key' => 'TestKey',
79+
'secret' => 'TestSecret',
80+
'app_id' => '1234',
81+
'options' => [
82+
'cluster' => 'mt1',
83+
'encrypted' => true,
84+
'host' => '127.0.0.1',
85+
'port' => 6001,
86+
'scheme' => 'http',
87+
],
88+
]
89+
);
90+
91+
if (in_array($replicationDriver, ['redis'])) {
92+
$app['config']->set('broadcasting.default', 'websockets');
93+
}
7394
}
7495

7596
protected function getWebSocketConnection(string $url = '/?appKey=TestKey'): Connection

0 commit comments

Comments
 (0)