mirror of
https://github.com/danog/byte-stream.git
synced 2024-11-26 20:04:51 +01:00
20 lines
448 B
PHP
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());
|
|
});
|
|
}
|
|
}
|