public function testException() { $e = new Exception\LdapException(null, '', 0); $this->assertEquals('no exception message', $e->getMessage()); $this->assertEquals(0, $e->getCode()); $e = new Exception\LdapException(null, '', 15); $this->assertEquals('0xf: no exception message', $e->getMessage()); $this->assertEquals(15, $e->getCode()); }
/** * Treat a Zend Ldap Exception. * * @param ZendLdapException $exception */ protected function zendExceptionHandler(ZendLdapException $exception) { switch ($exception->getCode()) { // Error level codes case ZendLdapException::LDAP_SERVER_DOWN: if ($this->logger) { $this->logger->err($exception->getMessage()); } break; // Other level codes // Other level codes default: $this->logDebug($exception->getMessage()); break; } }