public function testProxiesToFunction() { $self = $this; $s = new FnStream(array('read' => function ($len) use($self) { $self->assertEquals(3, $len); return 'foo'; })); $this->assertEquals('foo', $s->read(3)); }