public function testDetachClearsBuffer() { $b = new BufferStream(); $b->write('foo'); $b->detach(); $this->assertTrue($b->eof()); $this->assertEquals(3, $b->write('abc')); $this->assertEquals('abc', $b->read(10)); }