/** * @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; }
/** * @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; }
/** * 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); }
/** * 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); }