namespace Symfony\Component\Mime\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mime\CharacterStream;
class CharacterStreamTest extends TestCase
{ public function testReadCharactersAreInTact() { $stream =
new CharacterStream(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE
));
$stream->
write(pack('C*',
0xD0, 0xBB,
0xD1, 0x8E,
0xD0, 0xB1,
0xD1, 0x8B,
0xD1, 0x85
));
$this->
assertSame(pack('C*', 0xD0, 0x94
),
$stream->
read(1
));
$this->
assertSame(pack('C*', 0xD0, 0xB6, 0xD0, 0xBE
),
$stream->
read(2
));
$this->
assertSame(pack('C*', 0xD0, 0xBB
),
$stream->
read(1
));
$this->
assertSame(pack('C*', 0xD1, 0x8E, 0xD0, 0xB1, 0xD1, 0x8B
),
$stream->
read(3
));