WebSocketServerTest::is_server_running()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 4
b 0
f 0
nc 1
nop 0
dl 0
loc 11
rs 10
1
<?php
2
3
namespace WSSCTEST;
4
5
use PHPUnit\Framework\TestCase;
6
use WSSC\Components\ServerConfig;
7
use WSSC\WebSocketServer;
8
9
class WebSocketServerTest extends TestCase
10
{
11
    /**
12
     * @test
13
     * @throws \WSSC\Exceptions\WebSocketException
14
     * @throws \WSSC\Exceptions\ConnectionException
15
     */
16
    public static function is_server_running()
17
    {
18
        echo 'Running server...' . PHP_EOL;
19
20
        $config = new ServerConfig();
21
        $config->setClientsPerFork(2500);
22
        $config->setStreamSelectTimeout(2 * 3600);
23
        $config->setLoopingDelay(1);
24
25
        $websocketServer = new WebSocketServer(new ServerHandler(), $config);
26
        $websocketServer->run();
27
    }
28
}
29