mirror of
https://github.com/pmmp/ext-encoding.git
synced 2024-11-23 13:36:25 +00:00
9a5d74ab2a
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.
22 lines
390 B
PHP
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"
|