1
0
mirror of https://github.com/danog/byte-stream.git synced 2024-11-30 04:19:23 +01:00
byte-stream/test/InMemoryStreamTest.php
2018-09-22 16:04:00 +02:00

20 lines
448 B
PHP

<?php
namespace Amp\ByteStream\Test;
use Amp\ByteStream\InMemoryStream;
use Amp\Loop;
use PHPUnit\Framework\TestCase;
class InMemoryStreamTest extends TestCase
{
public function testSingleReadConsumesEverything()
{
Loop::run(function () {
$stream = new InMemoryStream("foobar");
$this->assertSame("foobar", yield $stream->read());
$this->assertNull(yield $stream->read());
});
}
}