1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/13361] Add tests

PHPBB3-13361
This commit is contained in:
Tristan Darricau
2015-01-10 18:15:19 +01:00
parent 74e8f9bd4e
commit 1f4bb2c149
3 changed files with 111 additions and 5 deletions

View File

@@ -54,8 +54,6 @@ class kernel_exception_subscriber implements EventSubscriberInterface
*/
public function on_kernel_exception(GetResponseForExceptionEvent $event)
{
page_header($this->user->lang('INFORMATION'));
$exception = $event->getException();
$message = $exception->getMessage();
@@ -67,6 +65,8 @@ class kernel_exception_subscriber implements EventSubscriberInterface
if (!$event->getRequest()->isXmlHttpRequest())
{
page_header($this->user->lang('INFORMATION'));
$this->template->assign_vars(array(
'MESSAGE_TITLE' => $this->user->lang('INFORMATION'),
'MESSAGE_TEXT' => $message,
@@ -83,7 +83,11 @@ class kernel_exception_subscriber implements EventSubscriberInterface
else
{
$data = array();
$data['message'] = $message;
if (!empty($message))
{
$data['message'] = $message;
}
if (defined('DEBUG'))
{

View File

@@ -13,10 +13,12 @@
namespace phpbb\exception;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
/**
* Class http_exception
*/
class http_exception extends exception implements exception_interface
class http_exception extends exception implements HttpExceptionInterface
{
/**
* Http status code.
@@ -47,7 +49,7 @@ class http_exception extends exception implements exception_interface
$this->status_code = $status_code;
$this->headers = $headers;
parent::__construct($message, $code, $previous);
parent::__construct($message, $parameters, $previous, $code);
}
/**