laravel-websockets/tests/TestsReplication.php

23 lines
558 B
PHP
Raw Normal View History

<?php
namespace BeyondCode\LaravelWebSockets\Tests;
use Illuminate\Support\Facades\Config;
use BeyondCode\LaravelWebSockets\PubSub\Drivers\LocalClient;
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
trait TestsReplication
{
public function setupReplication()
{
app()->singleton(ReplicationInterface::class, function () {
return new LocalClient();
});
2019-07-28 18:50:10 +00:00
Config::set([
'websockets.replication.enabled' => true,
2019-07-28 18:50:10 +00:00
'websockets.replication.driver' => 'redis',
]);
}
}