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

18 lines
444 B
PHP
Raw Normal View History

2017-05-08 11:15:10 +02:00
<?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());
});
}
}