Initial commit
This commit is contained in:
23
tests/Json/NativeMessagingProtocolTest.php
Normal file
23
tests/Json/NativeMessagingProtocolTest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace NoccyLabs\React\Protocol\Json;
|
||||
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use React\Stream\CompositeStream;
|
||||
use React\Stream\ThroughStream;
|
||||
|
||||
#[CoversClass(JsonProtocol::class)]
|
||||
#[CoversClass(NativeMessagingProtocol::class)]
|
||||
class NativeMessagingProtocolTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
|
||||
public function testFramePacking()
|
||||
{
|
||||
$proto = new NativeMessagingProtocol();
|
||||
|
||||
$packed = $proto->packFrame([ 'method' => 'foo', 'params' => [ 'bar' => true ] ]);
|
||||
|
||||
$this->assertEquals("\x26\x00\x00\x00".'{"method":"foo","params":{"bar":true}}', $packed);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user