laravel-websockets/tests/Commands/StartServerTest.php

52 lines
1.4 KiB
PHP
Raw Permalink Normal View History

2020-09-10 19:59:26 +00:00
<?php
2025-01-16 07:54:02 +00:00
namespace BlaxSoftware\LaravelWebSockets\Test\Commands;
2020-09-10 19:59:26 +00:00
2025-01-16 07:54:02 +00:00
use BlaxSoftware\LaravelWebSockets\Test\TestCase;
2020-09-10 19:59:26 +00:00
class StartServerTest extends TestCase
{
public function test_does_not_fail_if_building_up()
{
$this->loop->futureTick(function () {
$this->loop->stop();
});
$this->artisan('websockets:serve', ['--loop' => $this->loop, '--debug' => true, '--port' => 6001]);
$this->assertTrue(true);
}
public function test_pcntl_sigint_signal()
{
$this->loop->futureTick(function () {
$this->newActiveConnection(['public-channel']);
$this->newActiveConnection(['public-channel']);
posix_kill(posix_getpid(), SIGINT);
$this->loop->stop();
});
$this->artisan('websockets:serve', ['--loop' => $this->loop, '--debug' => true, '--port' => 6002]);
$this->assertTrue(true);
}
public function test_pcntl_sigterm_signal()
{
$this->loop->futureTick(function () {
$this->newActiveConnection(['public-channel']);
$this->newActiveConnection(['public-channel']);
posix_kill(posix_getpid(), SIGTERM);
$this->loop->stop();
});
$this->artisan('websockets:serve', ['--loop' => $this->loop, '--debug' => true, '--port' => 6003]);
2020-09-10 19:59:26 +00:00
$this->assertTrue(true);
}
}