Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function it_sends_msg_over_ssl() |
||
31 | { |
||
32 | $recvMsg = '{"user_id" : 123}'; |
||
33 | $client = new WebSocketClient($this->url, (new ClientConfig())->setContextOptions([ |
||
34 | 'ssl' => [ |
||
35 | 'allow_self_signed' => true, |
||
36 | 'verify_peer' => false, |
||
37 | // 'cafile' => './tests/certs/cert.pem', |
||
38 | 'local_cert' => './tests/certs/cert.pem', |
||
39 | ] |
||
40 | ])); |
||
41 | try { |
||
42 | $client->send($recvMsg); |
||
43 | } catch (BadOpcodeException $e) { |
||
44 | echo 'Couldn`t sent: ' . $e->getMessage(); |
||
45 | } |
||
46 | $recv = $client->receive(); |
||
47 | $this->assertEquals($recv, $recvMsg); |
||
48 | } |
||
49 | } |