1
0
mirror of https://github.com/danog/byte-stream.git synced 2024-12-03 09:47:49 +01:00
byte-stream/test/InMemoryStreamTest.php
2017-05-11 18:08:45 -05:00

18 lines
444 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());
});
}
}