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