public function register(Closure $callback) { self::$packages[$this->name] = $callback; return $this; }
/** * 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(); }