Skip to content

Commit 8facb9b

Browse files
committed
properly set request attributes in controller test
1 parent aec10e6 commit 8facb9b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ protected function findTemplate(Request $request, $format, $code, $showException
122122
// default to a generic HTML exception
123123
$request->setRequestFormat('html');
124124

125-
return new TemplateReference('TwigBundle', 'Exception', $this->debug ? 'exception_full' : $name, 'html', 'twig');
125+
return new TemplateReference('TwigBundle', 'Exception', $name, 'html', 'twig');
126126
}
127127

128128
// to be removed when the minimum required version of Twig is >= 2.0

src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public function testShowActionCanBeForcedToShowErrorPage()
5151
))
5252
);
5353

54-
$request = Request::create('whatever', 'GET', array('showException' => false));
54+
$request = Request::create('whatever', 'GET');
55+
$request->attributes->set('showException', false);
5556
$exception = FlattenException::create(new \Exception(), 404);
5657
$controller = new ExceptionController($twig, /* "showException" defaults to --> */ true);
5758

0 commit comments

Comments
 (0)