properly set request attributes in controller test
This commit is contained in:
parent
aec10e6a24
commit
b3db574a9f
@ -122,7 +122,7 @@ class ExceptionController
|
|||||||
// default to a generic HTML exception
|
// default to a generic HTML exception
|
||||||
$request->setRequestFormat('html');
|
$request->setRequestFormat('html');
|
||||||
|
|
||||||
return new TemplateReference('TwigBundle', 'Exception', $this->debug ? 'exception_full' : $name, 'html', 'twig');
|
return new TemplateReference('TwigBundle', 'Exception', $showException ? 'exception_full' : $name, 'html', 'twig');
|
||||||
}
|
}
|
||||||
|
|
||||||
// to be removed when the minimum required version of Twig is >= 2.0
|
// to be removed when the minimum required version of Twig is >= 2.0
|
||||||
|
@ -51,7 +51,8 @@ class ExceptionControllerTest extends TestCase
|
|||||||
))
|
))
|
||||||
);
|
);
|
||||||
|
|
||||||
$request = Request::create('whatever', 'GET', array('showException' => false));
|
$request = Request::create('whatever', 'GET');
|
||||||
|
$request->attributes->set('showException', false);
|
||||||
$exception = FlattenException::create(new \Exception(), 404);
|
$exception = FlattenException::create(new \Exception(), 404);
|
||||||
$controller = new ExceptionController($twig, /* "showException" defaults to --> */ true);
|
$controller = new ExceptionController($twig, /* "showException" defaults to --> */ true);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user