1
0
mirror of https://github.com/danog/byte-stream.git synced 2024-11-26 20:04:51 +01:00
byte-stream/test/BufferTest.php
2018-09-22 16:04:00 +02:00

20 lines
417 B
PHP

<?php
namespace Amp\ByteStream\Test;
use Amp\ByteStream\IteratorStream;
use Amp\Iterator;
use Amp\PHPUnit\TestCase;
use function Amp\ByteStream\buffer;
use function Amp\Promise\wait;
class BufferTest extends TestCase
{
public function testBuffer()
{
$stream = new IteratorStream(Iterator\fromIterable(["abc", "def", "g"], 10));
$this->assertSame("abcdefg", wait(buffer($stream)));
}
}