More code cleanup
This commit is contained in:
@ -13,18 +13,18 @@ class WebSocketCodecTest extends \PHPUnit\Framework\TestCase
|
||||
$codec = new WebSocketCodec();
|
||||
|
||||
$msg = $codec->encode([
|
||||
'opcode'=>WebSocketCodec::OP_PING,
|
||||
'opcode'=>WebSocketConnection::OP_PING,
|
||||
'payload'=>"ping"
|
||||
]);
|
||||
$this->assertEquals("\x89\x04ping", $msg);
|
||||
|
||||
$msg = $codec->encode([
|
||||
'opcode'=>WebSocketCodec::OP_FRAME_TEXT,
|
||||
'opcode'=>WebSocketConnection::OP_FRAME_TEXT,
|
||||
'payload'=>"abcdefgh"]);
|
||||
$this->assertEquals("\x81\x08abcdefgh", $msg);
|
||||
|
||||
$msg = $codec->encode([
|
||||
'opcode'=>WebSocketCodec::OP_FRAME_TEXT,
|
||||
'opcode'=>WebSocketConnection::OP_FRAME_TEXT,
|
||||
'payload'=>"abcdefgh",
|
||||
'masked'=>true,
|
||||
'mask'=>"\x00\x00\x00\x00"
|
||||
@ -32,7 +32,7 @@ class WebSocketCodecTest extends \PHPUnit\Framework\TestCase
|
||||
$this->assertEquals("\x81\x88\x00\x00\x00\x00abcdefgh", $msg);
|
||||
|
||||
$msg = $codec->encode([
|
||||
'opcode'=>WebSocketCodec::OP_FRAME_TEXT,
|
||||
'opcode'=>WebSocketConnection::OP_FRAME_TEXT,
|
||||
'payload'=>"abcdefgh",
|
||||
'masked'=>true,
|
||||
'mask'=>"\x00\xFF\x00\xFF"
|
||||
@ -47,7 +47,7 @@ class WebSocketCodecTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
$msg = $codec->decode("\x89\x04ping");
|
||||
$this->assertEquals([
|
||||
'opcode'=>WebSocketCodec::OP_PING,
|
||||
'opcode'=>WebSocketConnection::OP_PING,
|
||||
'payload'=>"ping",
|
||||
'final'=>true,
|
||||
'rsv1'=>false,
|
||||
@ -59,7 +59,7 @@ class WebSocketCodecTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
$msg = $codec->decode("\x81\x08abcdefgh");
|
||||
$this->assertEquals([
|
||||
'opcode'=>WebSocketCodec::OP_FRAME_TEXT,
|
||||
'opcode'=>WebSocketConnection::OP_FRAME_TEXT,
|
||||
'payload'=>"abcdefgh",
|
||||
'final'=>true,
|
||||
'rsv1'=>false,
|
||||
@ -71,7 +71,7 @@ class WebSocketCodecTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
$msg = $codec->decode("\x81\x88\x00\x00\x00\x00abcdefgh");
|
||||
$this->assertEquals([
|
||||
'opcode'=>WebSocketCodec::OP_FRAME_TEXT,
|
||||
'opcode'=>WebSocketConnection::OP_FRAME_TEXT,
|
||||
'payload'=>"abcdefgh",
|
||||
'final'=>true,
|
||||
'rsv1'=>false,
|
||||
@ -84,7 +84,7 @@ class WebSocketCodecTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
$msg = $codec->decode("\x81\x88\x00\xFF\x00\xFFa\x9dc\x9be\x99g\x97");
|
||||
$this->assertEquals([
|
||||
'opcode'=>WebSocketCodec::OP_FRAME_TEXT,
|
||||
'opcode'=>WebSocketConnection::OP_FRAME_TEXT,
|
||||
'payload'=>"abcdefgh",
|
||||
'final'=>true,
|
||||
'rsv1'=>false,
|
||||
|
Reference in New Issue
Block a user