/**
  * Unsubscribe a handler from an event
  * 
  * @param  CallbackHandler $handler 
  * @return bool Returns true if event and handle found, and unsubscribed; returns false if either event or handle not found
  */
 public function detach(CallbackHandler $handler)
 {
     $event = $handler->getEvent();
     if (empty($this->events[$event])) {
         return false;
     }
     $return = $this->events[$event]->remove($handler);
     if (!$return) {
         return false;
     }
     if (!count($this->events[$event])) {
         unset($this->events[$event]);
     }
     return true;
 }
 public function testGetEventShouldReturnEvent()
 {
     $handler = new CallbackHandler('foo', 'rand');
     $this->assertEquals('foo', $handler->getEvent());
 }