detachEvent() public method

route.pre route route.error route.post dispatch.pre dispatch dispatch.send dispatch.post dispatch.error
public detachEvent ( string $name, mixed $action ) : Project
$name string
$action mixed
return Project
Beispiel #1
0
 public function testEventManager()
 {
     $func = function () {
         return 'Hello World';
     };
     $p = new Project();
     $p->attachEvent('route.pre', $func, 2);
     $this->assertEquals(1, count($p->getEventManager()->get('route.pre')));
     $p->detachEvent('route.pre', $func);
     $this->assertEquals(0, count($p->getEventManager()->get('route.pre')));
 }