Esempio n. 1
0
 /**
  *  @dataProvider provider_test_parse
  */
 public function test_parse($encodedData, $expededData)
 {
     $frame = Frame::parse($encodedData);
     $this->assertEquals(md5($expededData), md5($frame->getData()));
 }
 protected function sendRaw($data)
 {
     $response = new ResponseWebSocketFrame(WebSocket\Frame::generate($data));
     $this->conn->write($response);
 }
Esempio n. 3
0
 /**
  * @return Frame
  */
 public function onMessage($data)
 {
     $this->messageQueue->add($data);
     return Frame::parse($this->messageQueue);
 }
 public function test__to_string()
 {
     $frame = Frame::generate(md5(microtime() . rand()));
     $response = new ResponseWebSocketFrame($frame);
     $this->assertEquals($frame->encode(), (string) $response);
 }