public function testNotFoundPageShowsCorrectCopyWhenVerboseErrorsDisabled() { $original = Settings::getSettings(); $settings = $original; $settings['errors']['verbose'] = false; Settings::setFromArray($settings); try { $this->request->dispatch("/notfound"); } catch (Exception $e) { $handler = new ErrorHandler(); $handler->setRequest($this->request); $handler->handleError($e); $this->assertResponseCode(404, $handler->getResponse()); $this->assertBodyHasContents("Oops! That’s a 404", $handler->getResponse()); $this->assertBodyHasContents("It looks like the page you’re after doesn’t exist", $handler->getResponse()); } Settings::setFromArray($original); }
$mode = getenv("PROJECT_MODE") !== false ? getenv("PROJECT_MODE") : "live"; //session_cache_limiter(false); try { // make sure a request object is available as soon as possible $request = JaossRequest::getInstance(); Settings::setMode($mode); include "library/boot.php"; include "library/load_apps.php"; if (Settings::getValue("date", "allow_from_cookie", false)) { $date = CookieJar::getInstance()->getCookie("test_date"); if ($date !== null) { Utils::setCurrentDate($date); } } $request->dispatch(); $response = $request->getResponse(); /* $response->setIfNoneMatch( $request->getHeader('If-None-Match') ); */ $response->send(); } catch (Exception $e) { $handler = new ErrorHandler(); $handler->setRequest($request); $handler->handleError($e); $response = $handler->getResponse(); $response->send(); } catch (Exception $e) { exit($e->getMessage()); }