Example #1
0
 public function testClosureCall()
 {
     $closure = function () {
         return 'closure:hello';
     };
     $callback = new Callback($closure);
     $this->assertEquals($callback->getType(), Callback::TYPE_CLOSURE);
     $this->assertEquals('closure:hello', $callback->call());
     // both allowed
     $callback = new Callback(NULL, $closure);
     $this->assertEquals($callback->getType(), Callback::TYPE_CLOSURE);
     $this->assertEquals('closure:hello', $callback->call());
 }