Skip to content

Commit 223d3ab

Browse files
committed
Merge branch '2.2' into 2.3
* 2.2: Update JsonResponse.php [HttpKernel] fixed the inline renderer when passing objects as attributes (closes #7124) [WebProfiler] fix content-type parameter Replace romaji period characters with Japanese style zenkaku period characters Passed the config when building the Configuration in ConfigurableExtension Conflicts: src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php
2 parents b6e6a19 + bd07efa commit 223d3ab

File tree

6 files changed

+113
-0
lines changed

6 files changed

+113
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller;
13+
14+
use Symfony\Component\HttpFoundation\Request;
15+
use Symfony\Component\HttpFoundation\Response;
16+
use Symfony\Component\DependencyInjection\ContainerAware;
17+
18+
class FragmentController extends ContainerAware
19+
{
20+
public function indexAction()
21+
{
22+
$actions = $this->container->get('templating')->get('actions');
23+
24+
return new Response($actions->render($actions->controller('TestBundle:Fragment:inlined', array(
25+
'options' => array(
26+
'bar' => new Bar(),
27+
'eleven' => 11,
28+
),
29+
))));
30+
}
31+
32+
public function inlinedAction($options, $_format)
33+
{
34+
return new Response($options['bar']->getBar().' '.$_format);
35+
}
36+
}
37+
38+
class Bar
39+
{
40+
private $bar = 'bar';
41+
42+
public function getBar()
43+
{
44+
return $this->bar;
45+
}
46+
}

Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,11 @@ subrequest_fragment:
3636
path: /subrequest/fragment/{_locale}.{_format}
3737
defaults: { _controller: TestBundle:SubRequest:fragment, _format: "html" }
3838
schemes: [http]
39+
40+
fragment_home:
41+
path: /fragment_home
42+
defaults: { _controller: TestBundle:Fragment:index, _format: txt }
43+
44+
fragment_inlined:
45+
path: /fragment_inlined
46+
defaults: { _controller: TestBundle:Fragment:inlined }

Tests/Functional/FragmentTest.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
13+
14+
/**
15+
* @group functional
16+
*/
17+
class FragmentTest extends WebTestCase
18+
{
19+
/**
20+
* @dataProvider getConfigs
21+
*/
22+
public function testFragment($insulate)
23+
{
24+
$client = $this->createClient(array('test_case' => 'Fragment', 'root_config' => 'config.yml'));
25+
if ($insulate) {
26+
$client->insulate();
27+
}
28+
29+
$client->request('GET', '/fragment_home');
30+
31+
$this->assertEquals('bar txt', $client->getResponse()->getContent());
32+
}
33+
34+
public function getConfigs()
35+
{
36+
return array(
37+
array(false),
38+
array(true),
39+
);
40+
}
41+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
4+
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
5+
6+
return array(
7+
new FrameworkBundle(),
8+
new TestBundle(),
9+
);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
imports:
2+
- { resource: ../config/default.yml }
3+
4+
framework:
5+
fragments: ~
6+
templating:
7+
engines: ['php']
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
_fragmenttest_bundle:
2+
resource: @TestBundle/Resources/config/routing.yml

0 commit comments

Comments
 (0)