laravel-websockets/tests/HealthTest.php

23 lines
491 B
PHP
Raw Permalink Normal View History

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->wsHandler = app(HealthHandler::class);
2020-09-12 20:48:18 +00:00
$this->wsHandler->onOpen($connection);
2020-09-12 20:48:18 +00:00
$this->assertTrue(
Str::contains($connection->sentRawData[0], '{"ok":true}')
);
}
}