8000 Merge branch '2.3' · symfony/symfony@99f97e5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 99f97e5

Browse files
committed
Merge branch '2.3'
* 2.3: Update JsonResponse.php [HttpKernel] fixed the inline renderer when passing objects as attributes (closes #7124) CookieJar remove unneeded var, Client remove unneeded else [DI] Fixed bug requesting non existing service from dumped frozen container Update validators.sk.xlf [WebProfiler] fix content-type parameter Replace romaji period characters with Japanese style zenkaku period characters fixed CS fixed CS [Console] Avoided an unnecessary check. Added missing French validator translations typo first->second Passed the config when building the Configuration in ConfigurableExtension removed unused code Fixed variable name used in translation cache Conflicts: src/Symfony/Component/Console/Event/ConsoleCommandEvent.php
2 parents afd79ea + 686bbb6 commit 99f97e5

File tree

93 files changed

+292
-166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+292
-166
lines changed

src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
namespace Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass;
1313

1414
use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
15-
use Symfony\Component\HttpKernel\Kernel;
16-
1715
use Symfony\Component\DependencyInjection\ContainerBuilder;
1816
use Symfony\Component\DependencyInjection\Definition;
1917
use Symfony\Component\DependencyInjection\Reference;

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/ContainerBuilderTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313

1414
require_once __DIR__ . '/Fixtures/includes/foo.php';
1515

16-
use ProxyManager\Configuration;
1716
use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator;
1817
use Symfony\Component\DependencyInjection\ContainerBuilder;
19-
use Symfony\Component\DependencyInjection\ContainerInterface;
2018

2119
/**
2220
* Integration tests for {@see \Symfony\Component\DependencyInjection\ContainerBuilder} combined

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Dumper/PhpDumperTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111

1212
namespace Symfony\Bridge\ProxyManager\LazyProxy\Tests\Dumper;
1313

14-
use ProxyManager\Configuration;
1514
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
1615
use Symfony\Component\DependencyInjection\ContainerBuilder;
17-
use Symfony\Component\DependencyInjection\ContainerInterface;
1816
use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
1917

2018
/**
@@ -46,7 +44,6 @@ public function testDumpContainerWithProxyService()
4644
);
4745
}
4846

49-
5047
/**
5148
* Verifies that the generated container retrieves the same proxy instance on multiple subsequent requests
5249
*/

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,5 +194,4 @@ public function getWrappedValueHolderValue()
194194
return $this->valueHolder5157dd96e88c0;
195195
}
196196

197-
198197
}

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Instantiator/RuntimeInstantiatorTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bridge\ProxyManager\LazyProxy\Tests\Instantiator;
1313

14-
use ProxyManager\Configuration;
1514
use ProxyManager\Proxy\LazyLoadingInterface;
1615
use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator;
1716
use Symfony\Component\DependencyInjection\ContainerInterface;

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
namespace Symfony\Bridge\ProxyManager\LazyProxy\Tests\Instantiator;
1313

14-
use ProxyManager\Configuration;
1514
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
16-
use Symfony\Component\DependencyInjection\ContainerInterface;
1715
use Symfony\Component\DependencyInjection\Definition;
1816

1917
/**

src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Symfony\Component\Console\Input\InputArgument;
2020
use Symfony\Component\Console\Input\InputOption;
2121
use Symfony\Component\Translation\MessageCatalogue;
22-
use Symfony\Component\Yaml\Yaml;
2322

2423
/**
2524
* A command that parse templates to extract translation messages and add them into the translation files.

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/SerializerPass.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ public function process(ContainerBuilder $container)
4141
private function findAndSortTaggedServices($tagName, ContainerBuilder $container)
4242
{
4343
$services = $container->findTaggedServiceIds($tagName);
44-
44+
4545
if (empty($services)) {
46-
throw new \RuntimeException(sprintf('You must tag at least one service as "%s" to use the Serializer service', $tagName));
46+
throw new \RuntimeException(sprintf('You must tag at least one service as "%s" to use the Serializer service', $tagName));
4747
}
48-
48+
4949
$sortedServices = array();
5050
foreach ($services as $serviceId => $tags) {
5151
foreach ($tags as $tag) {

src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ public function enctype(FormView $view)
138138
{
139139
// Uncomment this as soon as the deprecation note should be shown
140140
// trigger_error('The form helper $view[\'form\']->enctype() is deprecated since version 2.3 and will be removed in 3.0. Use $view[\'form\']->start() instead.', E_USER_DEPRECATED);
141-
142141
return $this->renderer->searchAndRenderBlock($view, 'enctype');
143142
}
144143

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
/**
1919
* Tests for the SerializerPass class
20-
*
20+
*
2121
* @author Javier Lopez <f12loalf@gmail.com>
2222
*/
2323
class SerializerPassTest extends \PHPUnit_Framework_TestCase
@@ -26,58 +26,58 @@ class SerializerPassTest extends \PHPUnit_Framework_TestCase
2626
public function testThrowExceptionWhenNoNormalizers()
2727
{
2828
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
29-
29+
3030
$container->expects($this->once())
3131
->method('hasDefinition')
3232
->with('serializer')
3333
->will($this->returnValue(true));
34-
34+
3535
$container->expects($this->once())
3636
->method('findTaggedServiceIds')
3737
->with('serializer.normalizer')
3838
->will($this->returnValue(array()));
39-
39+
4040
$this->setExpectedException('RuntimeException');
41-
41+
4242
$serializerPass = new SerializerPass();
4343
$serializerPass->process($container);
4444
}
45-
45+
4646
public function testThrowExceptionWhenNoEncoders()
4747
{
4848
$definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
4949
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
50-
50+
5151
$container->expects($this->once())
5252
->method('hasDefinition')
5353
->with('serializer')
5454
->will($this->returnValue(true));
55-
55+
5656
$container->expects($this->any())
5757
->method('findTaggedServiceIds')
5858
->will($this->onConsecutiveCalls(
5959
array('n' => array('serializer.normalizer')),
6060
array()
6161
));
62-
62+
6363
$container->expects($this->once())
6464
->method('getDefinition')
6565
->will($this->returnValue($definition));
66-
66+
6767
$this->setExpectedException('RuntimeException');
68-
68+
6969
$serializerPass = new SerializerPass();
7070
$serializerPass->process($container);
7171
}
72-
72+
7373
public function testServicesAreOrderedAccordingToPriority()
7474
{
7575
$services = array(
7676
'n3' => array('tag' => array()),
7777
'n1' => array('tag' => array('priority' => 200)),
7878
'n2' => array('tag' => array('priority' => 100))
7979
);
80-
80+
8181
$expected = array(
8282
new Reference('n1'),
8383
new Reference('n2'),
@@ -91,15 +91,15 @@ public function testServicesAreOrderedAccordingToPriority()
9191
->will($this->returnValue($services));
9292

9393
$serializerPass = new SerializerPass();
94-
94+
9595
$method = new \ReflectionMethod(
96-
'Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass',
96+
'Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass',
9797
'findAndSortTaggedServices'
9898
);
9999
$method->setAccessible(TRUE);
100-
100+
101101
$actual = $method->invoke($serializerPass, 'tag', $container);
102-
102+
103103
$this->assertEquals($expected, $actual);
104104
}
105105
}

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ protected static function getBundleDefaultConfig()
128128
'debug' => '%kernel.debug%',
129129
),
130130
'serializer' => array(
131-
'enabled' => false
131+
'enabled' => false
132132
)
133133
);
134134
}
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 <fabien@symfony.com>
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+
}

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SubRequestController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public function indexAction()
4545

4646
// The RouterListener is also tested as if it does not keep the right
4747
// Request in the context, a 301 would be generated
48-
4948
return new Response($content);
5049
}
5150

src/Symfony/Bundle/FrameworkBundle/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 }
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 <fabien@symfony.com>
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

src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TimedPhpEngineTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313

1414
use Symfony\Bundle\FrameworkBundle\Templating\TimedPhpEngine;
1515
use Symfony\Component\DependencyInjection\Container;
16-
use Symfony\Component\HttpFoundation\Request;
1716
use Symfony\Component\HttpFoundation\Session\Session;
18-
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
1917
use Symfony\Component\Templating\TemplateNameParser;
2018
use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables;
2119
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;

0 commit comments

Comments
 (0)
0