diff --git a/src/Symfony/Bridge/Twig/Extension/HttpKernelExtension.php b/src/Symfony/Bridge/Twig/Extension/HttpKernelExtension.php index cb18b5f6433b9..e20e1b9ae95a5 100644 --- a/src/Symfony/Bridge/Twig/Extension/HttpKernelExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/HttpKernelExtension.php @@ -11,7 +11,7 @@ namespace Symfony\Bridge\Twig\Extension; -use Symfony\Component\HttpKernel\HttpContentRenderer; +use Symfony\Component\HttpKernel\SubRequestRenderer; use Symfony\Component\HttpKernel\Controller\ControllerReference; /** @@ -26,9 +26,9 @@ class HttpKernelExtension extends \Twig_Extension /** * Constructor. * - * @param HttpContentRenderer $renderer A HttpContentRenderer instance + * @param SubRequestRenderer $renderer A SubRequestRenderer instance */ - public function __construct(HttpContentRenderer $renderer) + public function __construct(SubRequestRenderer $renderer) { $this->renderer = $renderer; } @@ -50,7 +50,7 @@ public function getFunctions() * * @return string The Response content * - * @see Symfony\Component\HttpKernel\HttpContentRenderer::render() + * @see Symfony\Component\HttpKernel\SubRequestRenderer::render() */ public function render($uri, $options = array()) { diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php index f9c3f31d537fe..d03d6984f7dc9 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php @@ -15,7 +15,7 @@ use Symfony\Bridge\Twig\Tests\TestCase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\HttpContentRenderer; +use Symfony\Component\HttpKernel\SubRequestRenderer; class HttpKernelExtensionTest extends TestCase { @@ -35,7 +35,7 @@ protected function setUp() */ public function testRenderWithError() { - $kernel = $this->getHttpContentRenderer($this->throwException(new \Exception('foo'))); + $kernel = $this->getSubRequestRenderer($this->throwException(new \Exception('foo'))); $loader = new \Twig_Loader_Array(array('index' => '{{ render("foo") }}')); $twig = new \Twig_Environment($loader, array('debug' => true, 'cache' => false)); @@ -44,7 +44,7 @@ public function testRenderWithError() $this->renderTemplate($kernel); } - protected function getHttpContentRenderer($return) + protected function getSubRequestRenderer($return) { $strategy = $this->getMock('Symfony\\Component\\HttpKernel\\RenderingStrategy\\RenderingStrategyInterface'); $strategy->expects($this->once())->method('getName')->will($this->returnValue('default')); @@ -58,13 +58,13 @@ protected function getHttpContentRenderer($return) ->will($this->returnValue(Request::create('/'))) ; - $renderer = new HttpContentRenderer(array($strategy)); + $renderer = new SubRequestRenderer(array($strategy)); $renderer->onKernelRequest($event); return $renderer; } - protected function renderTemplate(HttpContentRenderer $renderer, $template = '{{ render("foo") }}') + protected function renderTemplate(SubRequestRenderer $renderer, $template = '{{ render("foo") }}') { $loader = new \Twig_Loader_Array(array('index' => $template)); $twig = new \Twig_Environment($loader, array('debug' => true, 'cache' => false)); diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index 5725d442c0914..baf6d710f386e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -12,7 +12,7 @@ CHANGELOG * [BC BREAK] restricted the `Symfony\Bundle\FrameworkBundle\HttpKernel::render()` method to only accept URIs or ControllerReference instances * `Symfony\Bundle\FrameworkBundle\HttpKernel::render()` method signature changed and the first argument must now be a URI or a ControllerReference instance (the `generateInternalUri()` method was removed) - * The internal routes (`Resources/config/routing/internal.xml`) have been removed and replaced with a listener (`Symfony\Component\HttpKernel\EventListener\RouterProxyListener`) + * The internal routes (`Resources/config/routing/internal.xml`) have been removed and replaced with a listener (`Symfony\Component\HttpKernel\EventListener\SubRequestListener`) * The `render` method of the `actions` templating helper signature and arguments changed * replaced Symfony\Bundle\FrameworkBundle\Controller\TraceableControllerResolver by Symfony\Component\HttpKernel\Controller\TraceableControllerResolver * replaced Symfony\Component\HttpKernel\Debug\ContainerAwareTraceableEventDispatcher by Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/HttpRenderingStrategyPass.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/HttpRenderingStrategyPass.php index 3bb16f28c7036..76174f8142c24 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/HttpRenderingStrategyPass.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/HttpRenderingStrategyPass.php @@ -24,11 +24,11 @@ class HttpRenderingStrategyPass implements CompilerPassInterface { public function process(ContainerBuilder $container) { - if (false === $container->hasDefinition('http_content_renderer')) { + if (false === $container->hasDefinition('sub_request_renderer')) { return; } - $definition = $container->getDefinition('http_content_renderer'); + $definition = $container->getDefinition('sub_request_renderer'); foreach (array_keys($container->findTaggedServiceIds('kernel.content_renderer_strategy')) as $id) { // We must assume that the class value has been correctly filled, even if the service is created by a factory $class = $container->getDefinition($id)->getClass(); diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 9c04a3b284e57..3485ffaa52178 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -41,7 +41,7 @@ public function load(array $configs, ContainerBuilder $container) $loader->load('web.xml'); $loader->load('services.xml'); - $loader->load('content_generator.xml'); + $loader->load('sub_request.xml'); // A translator must always be registered (as support is included by // default in the Form component). If disabled, an identity translator diff --git a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php index 71a677cebeb0e..1b7caaa9916d8 100644 --- a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php @@ -67,17 +67,17 @@ public function forward($controller, array $attributes = array(), array $query = * @throws \RuntimeException * @throws \Exception * - * @deprecated in 2.2, will be removed in 2.3 (use Symfony\Component\HttpKernel\HttpContentRenderer::render() instead) + * @deprecated in 2.2, will be removed in 2.3 (use Symfony\Component\HttpKernel\SubRequestRenderer::render() instead) */ public function render($uri, array $options = array()) { - trigger_error('render() is deprecated since version 2.2 and will be removed in 2.3. Use Symfony\Component\HttpKernel\HttpContentRenderer::render() instead.', E_USER_DEPRECATED); + trigger_error('render() is deprecated since version 2.2 and will be removed in 2.3. Use Symfony\Component\HttpKernel\SubRequestRenderer::render() instead.', E_USER_DEPRECATED); $options = $this->renderer->fixOptions($options); $strategy = isset($options['strategy']) ? $options['strategy'] : 'default'; unset($options['strategy']); - $this->container->get('http_content_renderer')->render($uri, $strategy, $options); + $this->container->get('sub_request_renderer')->render($uri, $strategy, $options); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/content_generator.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/content_generator.xml deleted file mode 100644 index b9928df8c930a..0000000000000 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/content_generator.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Symfony\Component\HttpKernel\HttpContentRenderer - Symfony\Component\HttpKernel\RenderingStrategy\DefaultRenderingStrategy - Symfony\Bundle\FrameworkBundle\RenderingStrategy\ContainerAwareHIncludeRenderingStrategy - - /_proxy - - - - - - - %kernel.debug% - - - - - - %http_content_renderer.proxy_path% - - - - - - - %http_content_renderer.strategy.hinclude.global_template% - %http_content_renderer.proxy_path% - - - - diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml index 8f29f55457b32..3c6bb93d1e4ad 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml @@ -7,7 +7,7 @@ Symfony\Component\HttpKernel\HttpCache\Esi Symfony\Component\HttpKernel\EventListener\EsiListener - Symfony\Component\HttpKernel\RenderingStrategy\EsiRenderingStrategy + Symfony\Component\HttpKernel\RenderingStrategy\EsiRenderingStrategy @@ -18,11 +18,11 @@ - + - - %http_content_renderer.proxy_path% + + %sub_request_renderer.proxy_path% diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/proxy.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/proxy.xml index fca497721dfad..83522c11989fa 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/proxy.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/proxy.xml @@ -5,14 +5,14 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> - Symfony\Component\HttpKernel\EventListener\RouterProxyListener + Symfony\Component\HttpKernel\EventListener\SubRequestListener - + - %http_content_renderer.proxy_path% + %sub_request_renderer.proxy_path% diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/sub_request.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/sub_request.xml new file mode 100644 index 0000000000000..eb4eb237d5691 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/sub_request.xml @@ -0,0 +1,37 @@ + + + + + + Symfony\Component\HttpKernel\SubRequestRenderer + Symfony\Component\HttpKernel\RenderingStrategy\InlineRenderingStrategy + Symfony\Bundle\FrameworkBundle\RenderingStrategy\ContainerAwareHIncludeRenderingStrategy + + /_proxy + + + + + + + %kernel.debug% + + + + + + %sub_request_renderer.proxy_path% + + + + + + + %sub_request_renderer.strategy.hinclude.global_template% + %sub_request_renderer.proxy_path% + + + + diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml index f93c7c7db4c21..26a9ecbec36fe 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml @@ -81,7 +81,7 @@ - + diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php index f07adb2ce2052..5687752a68d4a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php @@ -12,7 +12,7 @@ namespace Symfony\Bundle\FrameworkBundle\Templating\Helper; use Symfony\Component\Templating\Helper\Helper; -use Symfony\Component\HttpKernel\HttpContentRenderer; +use Symfony\Component\HttpKernel\SubRequestRenderer; use Symfony\Component\HttpKernel\Controller\ControllerReference; /** @@ -27,9 +27,9 @@ class ActionsHelper extends Helper /** * Constructor. * - * @param HttpContentRenderer $renderer A HttpContentRenderer instance + * @param SubRequestRenderer $renderer A SubRequestRenderer instance */ - public function __construct(HttpContentRenderer $renderer) + public function __construct(SubRequestRenderer $renderer) { $this->renderer = $renderer; } @@ -42,7 +42,7 @@ public function __construct(HttpContentRenderer $renderer) * * @return string * - * @see Symfony\Component\HttpKernel\HttpContentRenderer::render() + * @see Symfony\Component\HttpKernel\SubRequestRenderer::render() */ public function render($uri, array $options = array()) { diff --git a/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml b/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml index 06306578e9028..bc4312e3cd261 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml +++ b/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml @@ -90,7 +90,7 @@ - + diff --git a/src/Symfony/Component/HttpKernel/CHANGELOG.md b/src/Symfony/Component/HttpKernel/CHANGELOG.md index 0bb901ec39d80..9f28690a10abd 100644 --- a/src/Symfony/Component/HttpKernel/CHANGELOG.md +++ b/src/Symfony/Component/HttpKernel/CHANGELOG.md @@ -4,12 +4,11 @@ CHANGELOG 2.2.0 ----- - * added Symfony\Component\HttpKernel\EventListener\RouterProxyListener * added Symfony\Component\HttpKernel\UriSigner - * added Symfony\Component\HttpKernel\HttpContentRenderer and rendering strategies (in Symfony\Component\HttpKernel\RenderingStrategy) - * added Symfony\Component\HttpKernel\EventListener\RouterProxyListener + * added Symfony\Component\HttpKernel\SubRequestRenderer and rendering strategies (in Symfony\Component\HttpKernel\RenderingStrategy) + * added Symfony\Component\HttpKernel\EventListener\SubRequestListener * added Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel - * added ControllerReference to create reference of Controllers (used in the HttpContentRenderer class) + * added ControllerReference to create reference of Controllers (used in the SubRequestRenderer class) * [BC BREAK] renamed TimeDataCollector::getTotalTime() to TimeDataCollector::getDuration() * updated the MemoryDataCollector to include the memory used in the diff --git a/src/Symfony/Component/HttpKernel/Controller/ControllerReference.php b/src/Symfony/Component/HttpKernel/Controller/ControllerReference.php index 905e89f5dc00b..173e2732263f1 100644 --- a/src/Symfony/Component/HttpKernel/Controller/ControllerReference.php +++ b/src/Symfony/Component/HttpKernel/Controller/ControllerReference.php @@ -20,7 +20,7 @@ * * @author Fabien Potencier * - * @see Symfony\Component\HttpKernel\HttpContentRenderer + * @see Symfony\Component\HttpKernel\SubRequestRenderer * @see Symfony\Component\HttpKernel\RenderingStrategy\RenderingStrategyInterface */ class ControllerReference diff --git a/src/Symfony/Component/HttpKernel/EventListener/RouterProxyListener.php b/src/Symfony/Component/HttpKernel/EventListener/SubRequestListener.php similarity index 98% rename from src/Symfony/Component/HttpKernel/EventListener/RouterProxyListener.php rename to src/Symfony/Component/HttpKernel/EventListener/SubRequestListener.php index 3554361ae3552..376b418d8540e 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/RouterProxyListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/SubRequestListener.php @@ -27,7 +27,7 @@ * * @author Fabien Potencier */ -class RouterProxyListener implements EventSubscriberInterface +class SubRequestListener implements EventSubscriberInterface { private $signer; private $proxyPath; diff --git a/src/Symfony/Component/HttpKernel/RenderingStrategy/EsiRenderingStrategy.php b/src/Symfony/Component/HttpKernel/RenderingStrategy/EsiRenderingStrategy.php index 195066d004945..55697d62a4a43 100644 --- a/src/Symfony/Component/HttpKernel/RenderingStrategy/EsiRenderingStrategy.php +++ b/src/Symfony/Component/HttpKernel/RenderingStrategy/EsiRenderingStrategy.php @@ -30,7 +30,7 @@ class EsiRenderingStrategy extends ProxyAwareRenderingStrategy * Constructor. * * The "fallback" strategy when ESI is not available should always be an - * instance of DefaultRenderingStrategy (or a class you are using for the + * instance of InlineRenderingStrategy (or a class you are using for the * default strategy). * * @param Esi $esi An Esi instance diff --git a/src/Symfony/Component/HttpKernel/RenderingStrategy/DefaultRenderingStrategy.php b/src/Symfony/Component/HttpKernel/RenderingStrategy/InlineRenderingStrategy.php similarity index 96% rename from src/Symfony/Component/HttpKernel/RenderingStrategy/DefaultRenderingStrategy.php rename to src/Symfony/Component/HttpKernel/RenderingStrategy/InlineRenderingStrategy.php index 5a3427e05e3c8..dfff95697e817 100644 --- a/src/Symfony/Component/HttpKernel/RenderingStrategy/DefaultRenderingStrategy.php +++ b/src/Symfony/Component/HttpKernel/RenderingStrategy/InlineRenderingStrategy.php @@ -21,7 +21,7 @@ * * @author Fabien Potencier */ -class DefaultRenderingStrategy extends ProxyAwareRenderingStrategy +class InlineRenderingStrategy extends ProxyAwareRenderingStrategy { private $kernel; @@ -95,6 +95,6 @@ protected function createSubRequest($uri, Request $request) */ public function getName() { - return 'default'; + return 'inline'; } } diff --git a/src/Symfony/Component/HttpKernel/RenderingStrategy/ProxyAwareRenderingStrategy.php b/src/Symfony/Component/HttpKernel/RenderingStrategy/ProxyAwareRenderingStrategy.php index 3c735efdeefe1..2a31e95a60762 100644 --- a/src/Symfony/Component/HttpKernel/RenderingStrategy/ProxyAwareRenderingStrategy.php +++ b/src/Symfony/Component/HttpKernel/RenderingStrategy/ProxyAwareRenderingStrategy.php @@ -13,7 +13,7 @@ use Symfony\Component\HttpKernel\Controller\ControllerReference; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\EventListener\RouterProxyListener; +use Symfony\Component\HttpKernel\EventListener\SubRequestListener; /** * Adds the possibility to generate a proxy URI for a given Controller. @@ -29,7 +29,7 @@ abstract class ProxyAwareRenderingStrategy implements RenderingStrategyInterface * * @param string $path The path * - * @see RouterProxyListener + * @see SubRequestListener */ public function setProxyPath($path) { diff --git a/src/Symfony/Component/HttpKernel/RenderingStrategy/RenderingStrategyInterface.php b/src/Symfony/Component/HttpKernel/RenderingStrategy/RenderingStrategyInterface.php index b4f8b8e50b405..0ba9ae49b1ab0 100644 --- a/src/Symfony/Component/HttpKernel/RenderingStrategy/RenderingStrategyInterface.php +++ b/src/Symfony/Component/HttpKernel/RenderingStrategy/RenderingStrategyInterface.php @@ -19,7 +19,7 @@ * * @author Fabien Potencier * - * @see Symfony\Component\HttpKernel\HttpContentRenderer + * @see Symfony\Component\HttpKernel\SubRequestRenderer */ interface RenderingStrategyInterface { diff --git a/src/Symfony/Component/HttpKernel/HttpContentRenderer.php b/src/Symfony/Component/HttpKernel/SubRequestRenderer.php similarity index 99% rename from src/Symfony/Component/HttpKernel/HttpContentRenderer.php rename to src/Symfony/Component/HttpKernel/SubRequestRenderer.php index d476bb2dba096..0bba434df4157 100644 --- a/src/Symfony/Component/HttpKernel/HttpContentRenderer.php +++ b/src/Symfony/Component/HttpKernel/SubRequestRenderer.php @@ -31,7 +31,7 @@ * * @see RenderingStrategyInterface */ -class HttpContentRenderer implements EventSubscriberInterface +class SubRequestRenderer implements EventSubscriberInterface { private $debug; private $strategies; diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterProxyListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/SubRequestListenerTest.php similarity index 87% rename from src/Symfony/Component/HttpKernel/Tests/EventListener/RouterProxyListenerTest.php rename to src/Symfony/Component/HttpKernel/Tests/EventListener/SubRequestListenerTest.php index f4a3356f6caa3..cd82740ffff6e 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterProxyListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/SubRequestListenerTest.php @@ -11,13 +11,13 @@ namespace Symfony\Component\HttpKernel\Tests\EventListener; -use Symfony\Component\HttpKernel\EventListener\RouterProxyListener; +use Symfony\Component\HttpKernel\EventListener\SubRequestListener; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\UriSigner; -class RouterProxyListenerTest extends \PHPUnit_Framework_TestCase +class SubRequestListenerTest extends \PHPUnit_Framework_TestCase { protected function setUp() { @@ -30,7 +30,7 @@ public function testOnlyTriggeredOnProxyRoute() { $request = Request::create('http://example.com/foo?_path=foo%3Dbar%26_controller%3Dfoo'); - $listener = new RouterProxyListener(new UriSigner('foo')); + $listener = new SubRequestListener(new UriSigner('foo')); $event = $this->createGetResponseEvent($request); $expected = $request->attributes->all(); @@ -48,7 +48,7 @@ public function testAccessDeniedWithNonSafeMethods() { $request = Request::create('http://example.com/_proxy', 'POST'); - $listener = new RouterProxyListener(new UriSigner('foo')); + $listener = new SubRequestListener(new UriSigner('foo')); $event = $this->createGetResponseEvent($request); $listener->onKernelRequest($event); @@ -61,7 +61,7 @@ public function testAccessDeniedWithNonLocalIps() { $request = Request::create('http://example.com/_proxy', 'GET', array(), array(), array(), array('REMOTE_ADDR' => '10.0.0.1')); - $listener = new RouterProxyListener(new UriSigner('foo')); + $listener = new SubRequestListener(new UriSigner('foo')); $event = $this->createGetResponseEvent($request); $listener->onKernelRequest($event); @@ -74,7 +74,7 @@ public function testAccessDeniedWithWrongSignature() { $request = Request::create('http://example.com/_proxy', 'GET', array(), array(), array(), array('REMOTE_ADDR' => '10.0.0.1')); - $listener = new RouterProxyListener(new UriSigner('foo')); + $listener = new SubRequestListener(new UriSigner('foo')); $event = $this->createGetResponseEvent($request); $listener->onKernelRequest($event); @@ -85,7 +85,7 @@ public function testWithSignature() $signer = new UriSigner('foo'); $request = Request::create($signer->sign('http://example.com/_proxy?_path=foo%3Dbar%26_controller%3Dfoo'), 'GET', array(), array(), array(), array('REMOTE_ADDR' => '10.0.0.1')); - $listener = new RouterProxyListener($signer); + $listener = new SubRequestListener($signer); $event = $this->createGetResponseEvent($request); $listener->onKernelRequest($event); diff --git a/src/Symfony/Component/HttpKernel/Tests/RenderingStrategy/EsiRenderingStrategyTest.php b/src/Symfony/Component/HttpKernel/Tests/RenderingStrategy/EsiRenderingStrategyTest.php index 99c51926e43fa..c2719b10d244b 100644 --- a/src/Symfony/Component/HttpKernel/Tests/RenderingStrategy/EsiRenderingStrategyTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/RenderingStrategy/EsiRenderingStrategyTest.php @@ -52,7 +52,7 @@ public function testRender() private function getDefaultStrategy($called = false) { - $default = $this->getMockBuilder('Symfony\Component\HttpKernel\RenderingStrategy\DefaultRenderingStrategy')->disableOriginalConstructor()->getMock(); + $default = $this->getMockBuilder('Symfony\Component\HttpKernel\RenderingStrategy\InlineRenderingStrategy')->disableOriginalConstructor()->getMock(); if ($called) { $default->expects($this->once())->method('render'); diff --git a/src/Symfony/Component/HttpKernel/Tests/RenderingStrategy/DefaultRenderingStrategyTest.php b/src/Symfony/Component/HttpKernel/Tests/RenderingStrategy/InlineRenderingStrategyTest.php similarity index 81% rename from src/Symfony/Component/HttpKernel/Tests/RenderingStrategy/DefaultRenderingStrategyTest.php rename to src/Symfony/Component/HttpKernel/Tests/RenderingStrategy/InlineRenderingStrategyTest.php index 5d1d4c92d6e32..1957aa710e7f9 100644 --- a/src/Symfony/Component/HttpKernel/Tests/RenderingStrategy/DefaultRenderingStrategyTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/RenderingStrategy/InlineRenderingStrategyTest.php @@ -13,12 +13,12 @@ use Symfony\Component\HttpKernel\Controller\ControllerReference; use Symfony\Component\HttpKernel\HttpKernel; -use Symfony\Component\HttpKernel\RenderingStrategy\DefaultRenderingStrategy; +use Symfony\Component\HttpKernel\RenderingStrategy\InlineRenderingStrategy; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\EventDispatcher\EventDispatcher; -class DefaultRenderingStrategyTest extends \PHPUnit_Framework_TestCase +class InlineRenderingStrategyTest extends \PHPUnit_Framework_TestCase { protected function setUp() { @@ -33,14 +33,14 @@ protected function setUp() public function testRender() { - $strategy = new DefaultRenderingStrategy($this->getKernel($this->returnValue(new Response('foo')))); + $strategy = new InlineRenderingStrategy($this->getKernel($this->returnValue(new Response('foo')))); $this->assertEquals('foo', $strategy->render('/', Request::create('/'))->getContent()); } public function testRenderWithControllerReference() { - $strategy = new DefaultRenderingStrategy($this->getKernel($this->returnValue(new Response('foo')))); + $strategy = new InlineRenderingStrategy($this->getKernel($this->returnValue(new Response('foo')))); $this->assertEquals('foo', $strategy->render(new ControllerReference('main_controller', array(), array()), Request::create('/'))->getContent()); } @@ -50,21 +50,21 @@ public function testRenderWithControllerReference() */ public function testRenderExceptionNoIgnoreErrors() { - $strategy = new DefaultRenderingStrategy($this->getKernel($this->throwException(new \RuntimeException('foo')))); + $strategy = new InlineRenderingStrategy($this->getKernel($this->throwException(new \RuntimeException('foo')))); $this->assertEquals('foo', $strategy->render('/', Request::create('/'))->getContent()); } public function testRenderExceptionIgnoreErrors() { - $strategy = new DefaultRenderingStrategy($this->getKernel($this->throwException(new \RuntimeException('foo')))); + $strategy = new InlineRenderingStrategy($this->getKernel($this->throwException(new \RuntimeException('foo')))); $this->assertEmpty($strategy->render('/', Request::create('/'), array('ignore_errors' => true))->getContent()); } public function testRenderExceptionIgnoreErrorsWithAlt() { - $strategy = new DefaultRenderingStrategy($this->getKernel($this->onConsecutiveCalls( + $strategy = new InlineRenderingStrategy($this->getKernel($this->onConsecutiveCalls( $this->throwException(new \RuntimeException('foo')), $this->returnValue(new Response('bar')) ))); @@ -103,7 +103,7 @@ public function testExceptionInSubRequestsDoesNotMangleOutputBuffers() ; $kernel = new HttpKernel(new EventDispatcher(), $resolver); - $renderer = new DefaultRenderingStrategy($kernel); + $renderer = new InlineRenderingStrategy($kernel); // simulate a main request with output buffering ob_start(); diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpContentRendererTest.php b/src/Symfony/Component/HttpKernel/Tests/SubRequestRendererTest.php similarity index 93% rename from src/Symfony/Component/HttpKernel/Tests/HttpContentRendererTest.php rename to src/Symfony/Component/HttpKernel/Tests/SubRequestRendererTest.php index 38305c93d03db..f428be5089bd9 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpContentRendererTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/SubRequestRendererTest.php @@ -11,11 +11,11 @@ namespace Symfony\Component\HttpKernel\Tests; -use Symfony\Component\HttpKernel\HttpContentRenderer; +use Symfony\Component\HttpKernel\SubRequestRenderer; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -class HttpContentRendererTest extends \PHPUnit_Framework_TestCase +class SubRequestRendererTest extends \PHPUnit_Framework_TestCase { protected function setUp() { @@ -29,7 +29,7 @@ protected function setUp() */ public function testRenderWhenStrategyDoesNotExist() { - $renderer = new HttpContentRenderer(); + $renderer = new SubRequestRenderer(); $renderer->render('/', 'foo'); } @@ -69,7 +69,7 @@ public function testRender() */ public function testFixOptions($expected, $options) { - $renderer = new HttpContentRenderer(); + $renderer = new SubRequestRenderer(); set_error_handler(function ($errorNumber, $message, $file, $line, $context) { return $errorNumber & E_USER_DEPRECATED; }); $this->assertEquals($expected, $renderer->fixOptions($options)); @@ -108,7 +108,7 @@ protected function getStrategy($returnValue, $arguments = array()) protected function getRenderer($strategy) { - $renderer = new HttpContentRenderer(); + $renderer = new SubRequestRenderer(); $renderer->addStrategy($strategy); $event = $this->getMockBuilder('Symfony\Component\HttpKernel\Event\GetResponseEvent')->disableOriginalConstructor()->getMock();