public function testCanGetGlobalAndLocalHandlers() { $handlerMock = $this->_getEventHandlerMock(); $eventHandlerList = new EventHandlerList(); $eventHandlerList->register('EventHandlerMock', $handlerMock); $e = new EventEmitter($eventHandlerList); $e->registerHandler("myHandler1", $handlerMock); $this->assertTrue($e->hasHandler('EventHandlerMock')); $this->assertTrue($e->hasHandler('myHandler1')); }
public function testRemoveUnregisteredHandlerThrowsException() { $this->setExpectedException("Mamoreno\\Pesy\\Exception\\UnregisteredEventHandlerException"); $l = new EventHandlerList(); $l->remove("test"); }