1
0
mirror of https://github.com/pmmp/ext-encoding.git synced 2024-11-23 13:36:25 +00:00
ext-encoding/tests/byte-buffer-new.phpt
Dylan K. Taylor 9a5d74ab2a
Separate read and write offsets
this isn't an ideal solution, but it's the easiest one available and gives time to figure out next steps for the API design.
2024-01-30 14:25:44 +00:00

22 lines
390 B
PHP

--TEST--
Test that new ByteBuffer() works correctly
--FILE--
<?php
use pmmp\encoding\ByteBuffer;
$buffer = new ByteBuffer("abc");
var_dump($buffer->toString());
$buffer = new ByteBuffer();
var_dump($buffer->toString());
$buffer = new ByteBuffer("hello world");
$buffer->setReadOffset(6);
var_dump($buffer->readByteArray(5));
?>
--EXPECT--
string(3) "abc"
string(0) ""
string(5) "world"