Completed
Push — master ( 0f7687...6db947 )
by Arthur
01:19
created

WebSocketSslServerTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A is_server_running() 0 13 1
1
<?php
2
3
4
namespace WSSCTEST;
5
6
7
use PHPUnit\Framework\TestCase;
8
use WSSC\Components\ServerConfig;
9
use WSSC\WebSocketServer;
10
11
class WebSocketSslServerTest extends TestCase
12
{
13
    /**
14
     * @test
15
     * @throws \WSSC\Exceptions\WebSocketException
16
     * @throws \WSSC\Exceptions\ConnectionException
17
     */
18
    public static function is_server_running()
19
    {
20
        echo 'Running server...' . PHP_EOL;
21
22
        $config = new ServerConfig();
23
        $config->setIsSsl(true)->setAllowSelfSigned(true)
24
            ->setCryptoType(STREAM_CRYPTO_METHOD_SSLv23_SERVER)
25
            ->setLocalCert("./tests/certs/cert.pem")->setLocalPk("./tests/certs/key.pem")
26
            ->setPort(8888);
27
28
        $websocketServer = new WebSocketServer(new ServerHandler(), $config);
29
        $websocketServer->run();
30
    }
31
}