public function testProxiesToFunction() { $s = new FnStream(['read' => function ($len) { $this->assertEquals(3, $len); return 'foo'; }]); $this->assertEquals('foo', $s->read(3)); }
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)); }