/** * @covers React\Stream\Buffer::write * @covers React\Stream\Buffer::close */ public function testWritingToClosedBufferShouldNotWriteToStream() { $stream = fopen('php://temp', 'r+'); $loop = $this->createWriteableLoopMock(); $buffer = new Buffer($stream, $loop); $buffer->close(); $buffer->write('foo'); rewind($stream); $this->assertSame('', stream_get_contents($stream)); }