register() public method

register package
public register ( Closure $callback ) : static
$callback Closure callback
return static $this
Exemplo n.º 1
0
 /**
  * testLoad
  *
  * @param Package $p
  *
  * @depends testRegister
  */
 public function testLoad(Package $p)
 {
     $self = $this;
     $p->register(function ($handler) use($self) {
         $hi = $handler->sayHi();
         $self->assertEquals('hi', $hi);
     });
     $p->load();
 }