Esempio n. 1
0
 /**
  * @param EventBaseInterface $base
  * @depends testBaseInit
  *
  * @return EventBase
  */
 public function testBaseException(EventBaseInterface $base)
 {
     $exception = new EventException();
     $this->assertInstanceOf('Libevent\\Exception\\EventException', $exception->setBase($base));
     $this->assertInstanceOf('Libevent\\Base\\EventBaseInterface', $exception->getBase());
     return $base;
 }
Esempio n. 2
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;
 }
Esempio n. 3
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);
 }
Esempio n. 4
0
 /**
  * Prepare exception for specified base
  * For php >= 5.4 will be nice
  * return (new EventException($message, EventException::BASE_EXCEPTION))->setBase($this);
  *
  * @param string $message
  *
  * @return EventException
  */
 protected function exception($message)
 {
     $exception = new EventException($message, EventException::BASE_EXCEPTION);
     return $exception->setBase($this);
 }