Initial commit

This commit is contained in:
Christopher Vagnetoft
2026-04-02 22:29:35 +02:00
commit 62a1167055
31 changed files with 3759 additions and 0 deletions

View 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);
}
}