Implemented more unit tests for PortalEventHandler (issue #242)