Exemple #1
0
 /**
  * @param EventInterface $event
  * @depends testEventVariables
  *
  * @return EventInterface
  */
 public function testEventExceptionSetGet(EventInterface $event)
 {
     $exception = new EventException();
     $this->assertInstanceOf('Libevent\\Exception\\EventException', $exception->setEvent($event));
     $this->assertInstanceOf('Libevent\\Event\\EventInterface', $exception->getEvent());
     return $event;
 }
Exemple #2
0
 /**
  * Prepare exception for specified event (can be overrided)
  * For php >= 5.4 will be nice
  * return (new EventException($message, EventException::EVENT_EXCEPTION))->setEvent($this);
  *
  * @param string $message
  *
  * @return EventException
  */
 protected function exception($message)
 {
     $exception = new EventException($message, $this->getExceptionCode());
     return $exception->setEvent($this);
 }