2020-09-12 20:48:18 +00:00
|
|
|
<?php
|
|
|
|
|
|
2025-01-16 07:54:02 +00:00
|
|
|
namespace BlaxSoftware\LaravelWebSockets\Test;
|
2020-09-12 20:48:18 +00:00
|
|
|
|
2025-01-16 07:54:02 +00:00
|
|
|
use BlaxSoftware\LaravelWebSockets\Server\HealthHandler;
|
2020-09-12 20:48:18 +00:00
|
|
|
use Illuminate\Support\Str;
|
|
|
|
|
|
|
|
|
|
class HealthTest extends TestCase
|
|
|
|
|
{
|
|
|
|
|
public function test_health_handler()
|
|
|
|
|
{
|
|
|
|
|
$connection = $this->newConnection();
|
|
|
|
|
|
|
|
|
|
$this->pusherServer = app(HealthHandler::class);
|
|
|
|
|
|
|
|
|
|
$this->pusherServer->onOpen($connection);
|
|
|
|
|
|
|
|
|
|
$this->assertTrue(
|
|
|
|
|
Str::contains($connection->sentRawData[0], '{"ok":true}')
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|