bug #12539 [TwigBundle] properly set request attributes in controller test (xabbuh)
This PR was merged into the 2.6 branch.
Discussion
----------
[TwigBundle] properly set request attributes in controller test
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
b3db574
properly set request attributes in controller test
This commit is contained in:
commit
45613b3ec5
@ -122,7 +122,7 @@ class ExceptionController
|
||||
// default to a generic HTML exception
|
||||
$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
|
||||
|
@ -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);
|
||||
$controller = new ExceptionController($twig, /* "showException" defaults to --> */ true);
|
||||
|
||||
|
Reference in New Issue
Block a user