File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
src/Symfony/Bundle/FrameworkBundle/Tests/Functional
Bundle/TestBundle/Controller Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 17
17
18
18
class FragmentController extends ContainerAware
19
19
{
20
- public function indexAction ()
20
+ public function indexAction (Request $ request )
21
21
{
22
22
$ actions = $ this ->container ->get ('templating ' )->get ('actions ' );
23
23
@@ -32,7 +32,10 @@ public function indexAction()
32
32
33
33
$ html3 = $ actions ->render ($ actions ->controller ('TestBundle:Fragment:customlocale ' , array ('_locale ' => 'es ' )));
34
34
35
- return new Response ($ html1 .'-- ' .$ html2 .'-- ' .$ html3 );
35
+ $ request ->setLocale ('fr ' );
36
+ $ html4 = $ actions ->render ($ actions ->controller ('TestBundle:Fragment:forwardlocale ' ));
37
+
38
+ return new Response ($ html1 .'-- ' .$ html2 .'-- ' .$ html3 .'-- ' .$ html4 );
36
39
}
37
40
38
41
public function inlinedAction ($ options , $ _format )
@@ -49,6 +52,11 @@ public function customLocaleAction(Request $request)
49
52
{
50
53
return new Response ($ request ->getLocale ());
51
54
}
55
+
56
+ public function forwardLocaleAction (Request $ request )
57
+ {
58
+ return new Response ($ request ->getLocale ());
59
+ }
52
60
}
53
61
54
62
class Bar
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public function testFragment($insulate)
28
28
29
29
$ client ->request ('GET ' , '/fragment_home ' );
30
30
31
- $ this ->assertEquals ('bar txt--html--es ' , $ client ->getResponse ()->getContent ());
31
+ $ this ->assertEquals ('bar txt--html--es--fr ' , $ client ->getResponse ()->getContent ());
32
32
}
33
33
34
34
public function getConfigs ()
You can’t perform that action at this time.
0 commit comments