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