Skip to content

Commit

Permalink
Add tests to the Frame::$byte10 property
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Mar 21, 2022
1 parent 3c6cc8c commit 9767044
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
29 changes: 29 additions & 0 deletions tests/Goridge/FrameTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Goridge;

use PHPUnit\Framework\TestCase;
use Spiral\Goridge\Frame;

class FrameTest extends TestCase
{
public function testByte10DefaultValue(): void
{
$frame = new Frame('');
$this->assertSame(0, $frame->byte10);
}

public function testByte10DefaultValuePacked(): void
{
$string = Frame::packFrame(new Frame(''));
$this->assertSame(\chr(0), $string[10]);
}

public function testByte10StreamedOutputPacked(): void
{
$frame = new Frame('');
$frame->byte10 = Frame::BYTE10_STREAM;
$string = Frame::packFrame($frame);
$this->assertSame(Frame::BYTE10_STREAM, \ord($string[10]));
}
}
1 change: 0 additions & 1 deletion tests/Goridge/MsgPackRPCTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Spiral\Goridge\Tests;

use Spiral\Goridge\RPC\Codec\MsgpackCodec;
use Spiral\Goridge\RPC\Exception\CodecException;
use Spiral\Goridge\RPC\Exception\ServiceException;
use Spiral\Goridge\RPC\RPC;

Expand Down

0 comments on commit 9767044

Please sign in to comment.