mirror of
https://github.com/danog/byte-stream.git
synced 2024-11-30 04:19:23 +01:00
Simplify OutputBuffer tests
This commit is contained in:
parent
48bb2ebf78
commit
e00c6d4926
@ -3,7 +3,6 @@
|
|||||||
namespace Amp\ByteStream\Test;
|
namespace Amp\ByteStream\Test;
|
||||||
|
|
||||||
use Amp\ByteStream\ClosedException;
|
use Amp\ByteStream\ClosedException;
|
||||||
use Amp\ByteStream\InMemoryStream;
|
|
||||||
use Amp\ByteStream\OutputBuffer;
|
use Amp\ByteStream\OutputBuffer;
|
||||||
use Amp\Loop;
|
use Amp\Loop;
|
||||||
use Amp\PHPUnit\TestCase;
|
use Amp\PHPUnit\TestCase;
|
||||||
@ -15,9 +14,7 @@ class OutputBufferTest extends TestCase {
|
|||||||
$output->write('foo');
|
$output->write('foo');
|
||||||
$output->end();
|
$output->end();
|
||||||
|
|
||||||
$memory = new InMemoryStream(yield $output);
|
$this->assertSame('foo', yield $output);
|
||||||
|
|
||||||
$this->assertSame('foo', yield $memory->read());
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,9 +24,7 @@ class OutputBufferTest extends TestCase {
|
|||||||
$output->write('foo');
|
$output->write('foo');
|
||||||
$output->end('bar');
|
$output->end('bar');
|
||||||
|
|
||||||
$memory = new InMemoryStream(yield $output);
|
$this->assertSame('foobar', yield $output);
|
||||||
|
|
||||||
$this->assertSame('foobar', yield $memory->read());
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user