Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add an action to show *error* pages in kernel.debug mode #12096

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add an extra test
  • Loading branch information
mpdude committed Oct 3, 2014
commit 65bafc0dc76858ffae182be3353ca244e5c5e808
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,22 @@ public function testErrorPagesInDebugMode()
$this->assertEquals(200, $response->getStatusCode()); // successful request
$this->assertEquals('OK', $response->getContent()); // content of the error404.html template
}

public function testFallbackToHtmlIfNoTemplateForRequestedFormat()
{
$twig = new \Twig_Environment(
new \Twig_Loader_Array(array(
'TwigBundle:Exception:error.html.twig' => 'html',
))
);

$request = Request::create('whatever');
$request->setRequestFormat('txt');

$controller = new ExceptionController($twig, false);
$response = $controller->testErrorPageAction($request, 42);

$this->assertEquals('html', $request->getRequestFormat());
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra empty line that should be removed.

}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.