mirror of
https://github.com/pmmp/ext-encoding.git
synced 2025-09-21 09:19:44 +00:00
closes #13 This prevents accidentally writing when reading is intended, and vice versa. It also allows specialising the APIs and constructors.
27 lines
496 B
PHP
27 lines
496 B
PHP
--TEST--
|
|
Test that ByteBufferReader serializes and unserializes correctly
|
|
--FILE--
|
|
<?php
|
|
|
|
use pmmp\encoding\ByteBufferReader;
|
|
|
|
$buffer = new ByteBufferReader("hello world");
|
|
$buffer2 = unserialize(serialize($buffer));
|
|
|
|
var_dump($buffer, $buffer2);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
object(pmmp\encoding\ByteBufferReader)#%d (2) {
|
|
["buffer"]=>
|
|
string(11) "hello world"
|
|
["offset"]=>
|
|
int(0)
|
|
}
|
|
object(pmmp\encoding\ByteBufferReader)#%d (2) {
|
|
["buffer"]=>
|
|
string(11) "hello world"
|
|
["offset"]=>
|
|
int(0)
|
|
}
|