public function testStopsCopyToStreamWhenWriteFails()
{
$s1 = Psr7\stream_for('foobaz');
$s2 = Psr7\stream_for('');
$s2 = FnStream::decorate($s2, ['write' => function () {
return 0;
}]);
Psr7\copy_to_stream($s1, $s2);
$this->assertEquals('', (string) $s2);
}