Skip to content

Commit fbeb2cd

Browse files
committed
fixed request format of sub-requests when explicitely set by the developer (closes #8787)
1 parent 6a8b6a0 commit fbeb2cd

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Tests/Functional/Bundle/TestBundle/Controller/FragmentController.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,27 @@ public function indexAction()
2020
{
2121
$actions = $this->container->get('templating')->get('actions');
2222

23-
return new Response($actions->render($actions->controller('TestBundle:Fragment:inlined', array(
23+
$html1 = $actions->render($actions->controller('TestBundle:Fragment:inlined', array(
2424
'options' => array(
2525
'bar' => new Bar(),
2626
'eleven' => 11,
2727
),
28-
))));
28+
)));
29+
30+
$html2 = $actions->render($actions->controller('TestBundle:Fragment:customformat', array('_format' => 'html')));
31+
32+
return new Response($html1.'--'.$html2);
2933
}
3034

3135
public function inlinedAction($options, $_format)
3236
{
3337
return new Response($options['bar']->getBar().' '.$_format);
3438
}
39+
40+
public function customFormatAction($_format)
41+
{
42+
return new Response($_format);
43+
}
3544
}
3645

3746
class Bar

Tests/Functional/FragmentTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testFragment($insulate)
2828

2929
$client->request('GET', '/fragment_home');
3030

31-
$this->assertEquals('bar txt', $client->getResponse()->getContent());
31+
$this->assertEquals('bar txt--html', $client->getResponse()->getContent());
3232
}
3333

3434
public function getConfigs()

0 commit comments

Comments
 (0)