Browse Source

merged branch Seldaek/event_listener (PR #1374)

Commits
-------

58b6403 Adjusted UPDATE
7350109 Renamed core.* events to kernel.* and CoreEvents to KernelEvents
edbdf7b Rename kernel.listener to kernel.event_listener

Discussion
----------

Rename kernel.listener to kernel.event_listener

Better consistency with doctrine.event_listener

---------------------------------------------------------------------------

by schmittjoh at 2011/06/20 07:39:18 -0700

I think "symfony.event_listener" would be even better then, or just short "event_listener".

There are some more inconsistencies:
- "core.response" -> "kernel.response" / "http_kernel.response"
- "core.request" -> "kernel.request"  / "http_kernel.request"
- "core.controller" -> "kernel.controller"  / "http_kernel.controller"
- "core.view" -> "kernel.view"  / "http_kernel.view"

---------------------------------------------------------------------------

by Seldaek at 2011/06/20 07:45:53 -0700

I proposed `event_listener` but @fabpot didn't like it, `symfony.event_listener` could do, but usual we refer to global stuff as framework more than symfony, so `framework.event_listener`?

The point is that the kernel "owns" the event dispatcher, even if anyone can dispatch his stuff through it. You still listen on the kernel dispatcher. So it's not that wrong imo.

As for the others. I agree that the "core" name is a bit strange. kernel would be more suitable imo. @fabpot?

---------------------------------------------------------------------------

by stof at 2011/06/20 07:50:35 -0700

@Seldaek the issue with having ``kernel`` in the tag name is that some user think that they need to define their own tag when they want to dispatch their own events (I faced it a few times on #symfony and it was also the case in #1298)

---------------------------------------------------------------------------

by Seldaek at 2011/06/20 07:51:55 -0700

Well yeah that's why I liked the idea of having only `event_listener`. IMO even with `framework.event_listener` the confusion can still happen.

---------------------------------------------------------------------------

by fabpot at 2011/06/20 08:00:23 -0700

Renaming `core.response` to `kernel.response` is fine with me.

---------------------------------------------------------------------------

by Seldaek at 2011/06/21 07:53:13 -0700

Ok, added another commit that does that renaming. Updated the two related PRs in -docs and -standard as well.
Fabien Potencier 14 years ago
parent
commit
ee95ff2fc5
38 changed files with 114 additions and 98 deletions
  1. 19 0
      UPDATE.md
  2. 1 1
      src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php
  3. 1 1
      src/Symfony/Bundle/FrameworkBundle/DataCollector/RequestDataCollector.php
  4. 2 2
      src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RegisterKernelListenersPass.php
  5. 1 1
      src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
  6. 2 2
      src/Symfony/Bundle/FrameworkBundle/EventListener/RouterListener.php
  7. 1 1
      src/Symfony/Bundle/FrameworkBundle/EventListener/SessionListener.php
  8. 3 3
      src/Symfony/Bundle/FrameworkBundle/EventListener/TestSessionListener.php
  9. 1 1
      src/Symfony/Bundle/FrameworkBundle/Resources/config/collectors.xml
  10. 1 1
      src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml
  11. 2 2
      src/Symfony/Bundle/FrameworkBundle/Resources/config/profiling.xml
  12. 2 2
      src/Symfony/Bundle/FrameworkBundle/Resources/config/test.xml
  13. 5 5
      src/Symfony/Bundle/FrameworkBundle/Resources/config/web.xml
  14. 1 1
      src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/RouterListenerTest.php
  15. 1 1
      src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/TestSessionListenerTest.php
  16. 1 1
      src/Symfony/Bundle/MonologBundle/DependencyInjection/MonologExtension.php
  17. 1 1
      src/Symfony/Bundle/SecurityBundle/EventListener/ResponseListener.php
  18. 1 1
      src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml
  19. 1 1
      src/Symfony/Bundle/SecurityBundle/Resources/config/security_rememberme.xml
  20. 2 2
      src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php
  21. 1 1
      src/Symfony/Bundle/WebProfilerBundle/Resources/config/toolbar.xml
  22. 8 8
      src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php
  23. 1 1
      src/Symfony/Component/HttpKernel/EventListener/EsiListener.php
  24. 1 1
      src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
  25. 5 5
      src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php
  26. 1 1
      src/Symfony/Component/HttpKernel/EventListener/ResponseListener.php
  27. 5 5
      src/Symfony/Component/HttpKernel/HttpKernel.php
  28. 6 6
      src/Symfony/Component/HttpKernel/CoreEvents.php
  29. 1 1
      src/Symfony/Component/Security/Http/Firewall.php
  30. 0 1
      src/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.php
  31. 0 1
      src/Symfony/Component/Security/Http/Firewall/AbstractPreAuthenticatedListener.php
  32. 3 3
      src/Symfony/Component/Security/Http/Firewall/ContextListener.php
  33. 4 4
      src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php
  34. 0 1
      src/Symfony/Component/Security/Http/Firewall/RememberMeListener.php
  35. 7 7
      tests/Symfony/Tests/Component/HttpKernel/EventListener/EsiListenerTest.php
  36. 4 4
      tests/Symfony/Tests/Component/HttpKernel/EventListener/ExceptionListenerTest.php
  37. 13 13
      tests/Symfony/Tests/Component/HttpKernel/EventListener/ResponseListenerTest.php
  38. 5 5
      tests/Symfony/Tests/Component/HttpKernel/HttpKernelTest.php

+ 19 - 0
UPDATE.md

@@ -21,6 +21,25 @@ beta5 to RC1
     * `attributes` to `widget_attributes`
     * `options` to `widget_choice_options`
 
+* Event changes:
+    * All listeners must now be tagged with `kernel.event_listener` instead of
+      `kernel.listener`:
+    * Kernel events are now properly prefixed with `kernel` instead of `core`:
+
+        * Before:
+
+                <tag name="kernel.listener" event="core.request" method="onCoreRequest" />
+
+        * After:
+
+                <tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" />
+
+    Note: the method can of course remain as `onCoreRequest`, but renaming it
+    as well for consistency with future projects makes sense.
+
+    * The `Symfony\Component\HttpKernel\CoreEvents` class has been renamed to
+      `Symfony\Component\HttpKernel\KernelEvents`
+
 beta4 to beta5
 --------------
 

+ 1 - 1
src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php

@@ -36,7 +36,7 @@ class FirePHPHandler extends BaseFirePHPHandler
     /**
      * Adds the headers to the response once it's created
      */
-    public function onCoreResponse(FilterResponseEvent $event)
+    public function onKernelResponse(FilterResponseEvent $event)
     {
         if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
             return;

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/DataCollector/RequestDataCollector.php

@@ -59,7 +59,7 @@ class RequestDataCollector extends BaseRequestDataCollector
         }
     }
 
-    public function onCoreController(FilterControllerEvent $event)
+    public function onKernelController(FilterControllerEvent $event)
     {
         $this->controllers[$event->getRequest()] = $event->getController();
     }

+ 2 - 2
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RegisterKernelListenersPass.php

@@ -25,12 +25,12 @@ class RegisterKernelListenersPass implements CompilerPassInterface
 
         $definition = $container->getDefinition('event_dispatcher');
 
-        foreach ($container->findTaggedServiceIds('kernel.listener') as $id => $events) {
+        foreach ($container->findTaggedServiceIds('kernel.event_listener') as $id => $events) {
             foreach ($events as $event) {
                 $priority = isset($event['priority']) ? $event['priority'] : 0;
 
                 if (!isset($event['event'])) {
-                    throw new \InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "kernel.listener" tags.', $id));
+                    throw new \InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "kernel.event_listener" tags.', $id));
                 }
 
                 if (!isset($event['method'])) {

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

@@ -127,7 +127,7 @@ class FrameworkExtension extends Extension
             'Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent',
             'Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent',
             'Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent',
-            'Symfony\\Component\\HttpKernel\\CoreEvents',
+            'Symfony\\Component\\HttpKernel\\KernelEvents',
 
             'Symfony\\Bundle\\FrameworkBundle\\EventListener\\RouterListener',
             'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerNameParser',

+ 2 - 2
src/Symfony/Bundle/FrameworkBundle/EventListener/RouterListener.php

@@ -42,7 +42,7 @@ class RouterListener
         $this->logger = $logger;
     }
 
-    public function onEarlyCoreRequest(GetResponseEvent $event)
+    public function onEarlyKernelRequest(GetResponseEvent $event)
     {
         if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
             return;
@@ -64,7 +64,7 @@ class RouterListener
         $this->router->setContext($context);
     }
 
-    public function onCoreRequest(GetResponseEvent $event)
+    public function onKernelRequest(GetResponseEvent $event)
     {
         $request = $event->getRequest();
 

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/EventListener/SessionListener.php

@@ -33,7 +33,7 @@ class SessionListener
         $this->container = $container;
     }
 
-    public function onCoreRequest(GetResponseEvent $event)
+    public function onKernelRequest(GetResponseEvent $event)
     {
         if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
             return;

+ 3 - 3
src/Symfony/Bundle/FrameworkBundle/EventListener/TestSessionListener.php

@@ -36,7 +36,7 @@ class TestSessionListener
         $this->container = $container;
     }
 
-    public function onCoreRequest(GetResponseEvent $event)
+    public function onKernelRequest(GetResponseEvent $event)
     {
         if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
             return;
@@ -55,11 +55,11 @@ class TestSessionListener
 
     /**
      * Checks if session was initialized and saves if current request is master
-     * Runs on 'core.response' in test environment
+     * Runs on 'kernel.response' in test environment
      *
      * @param FilterResponseEvent $event
      */
-    public function onCoreResponse(FilterResponseEvent $event)
+    public function onKernelResponse(FilterResponseEvent $event)
     {
         if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
             return;

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/Resources/config/collectors.xml

@@ -21,7 +21,7 @@
         </service>
 
         <service id="data_collector.request" class="%data_collector.request.class%">
-            <tag name="kernel.listener" event="core.controller" method="onCoreController"/>
+            <tag name="kernel.event_listener" event="kernel.controller" method="onKernelController"/>
             <tag name="data_collector" template="WebProfilerBundle:Collector:request" id="request" priority="255" />
         </service>
 

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml

@@ -13,7 +13,7 @@
         <service id="esi" class="%esi.class%" />
 
         <service id="esi_listener" class="%esi_listener.class%">
-          <tag name="kernel.listener" event="core.response" method="onCoreResponse" />
+          <tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse" />
           <argument type="service" id="esi" on-invalid="ignore" />
         </service>
     </services>

+ 2 - 2
src/Symfony/Bundle/FrameworkBundle/Resources/config/profiling.xml

@@ -24,8 +24,8 @@
         </service>
 
         <service id="profiler_listener" class="%profiler_listener.class%">
-            <tag name="kernel.listener" event="core.response" method="onCoreResponse" priority="-100" />
-            <tag name="kernel.listener" event="core.exception" method="onCoreException" />
+            <tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse" priority="-100" />
+            <tag name="kernel.event_listener" event="kernel.exception" method="onKernelException" />
             <argument type="service" id="profiler" />
             <argument type="service" id="profiler.request_matcher" on-invalid="null" />
             <argument>%profiler_listener.only_exceptions%</argument>

+ 2 - 2
src/Symfony/Bundle/FrameworkBundle/Resources/config/test.xml

@@ -26,8 +26,8 @@
 
         <service id="test.session.listener" class="%test.session.listener.class%">
             <argument type="service" id="service_container" />
-            <tag name="kernel.listener" event="core.request" method="onCoreRequest" priority="192" />
-            <tag name="kernel.listener" event="core.response" method="onCoreResponse" priority="-128" />
+            <tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" priority="192" />
+            <tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse" priority="-128" />
         </service>
     </services>
 </container>

+ 5 - 5
src/Symfony/Bundle/FrameworkBundle/Resources/config/web.xml

@@ -27,8 +27,8 @@
         </service>
 
         <service id="router_listener" class="%router_listener.class%">
-            <tag name="kernel.listener" event="core.request" method="onEarlyCoreRequest" priority="255" />
-            <tag name="kernel.listener" event="core.request" method="onCoreRequest" />
+            <tag name="kernel.event_listener" event="kernel.request" method="onEarlyKernelRequest" priority="255" />
+            <tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" />
             <tag name="monolog.logger" channel="request" />
             <argument type="service" id="router" />
             <argument>%request_listener.http_port%</argument>
@@ -37,17 +37,17 @@
         </service>
 
         <service id="session_listener" class="%session_listener.class%">
-            <tag name="kernel.listener" event="core.request" method="onCoreRequest" priority="128" />
+            <tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" priority="128" />
             <argument type="service" id="service_container" />
         </service>
 
         <service id="response_listener" class="%response_listener.class%">
-            <tag name="kernel.listener" event="core.response" method="onCoreResponse" />
+            <tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse" />
             <argument>%kernel.charset%</argument>
         </service>
 
         <service id="exception_listener" class="%exception_listener.class%">
-            <tag name="kernel.listener" event="core.exception" method="onCoreException" priority="-128" />
+            <tag name="kernel.event_listener" event="kernel.exception" method="onKernelException" priority="-128" />
             <tag name="monolog.logger" channel="request" />
             <argument>%exception_listener.controller%</argument>
             <argument type="service" id="logger" on-invalid="null" />

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/RouterListenerTest.php

@@ -49,7 +49,7 @@ class RouterListenerTest extends \PHPUnit_Framework_TestCase
                      ->with($expectedContext);
 
         $event = $this->createGetResponseEventForUri($uri);
-        $listener->onEarlyCoreRequest($event);
+        $listener->onEarlyKernelRequest($event);
     }
 
     public function getPortData()

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/Tests/EventListener/TestSessionListenerTest.php

@@ -62,7 +62,7 @@ class TestSessionListenerTest extends \PHPUnit_Framework_TestCase
         $kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
         $event = new FilterResponseEvent($kernel, $request, $type, $response);
 
-        $this->listener->onCoreResponse($event);
+        $this->listener->onKernelResponse($event);
 
         $this->assertSame($response, $event->getResponse());
     }

+ 1 - 1
src/Symfony/Bundle/MonologBundle/DependencyInjection/MonologExtension.php

@@ -127,7 +127,7 @@ class MonologExtension extends Extension
                 $handler['level'],
                 $handler['bubble'],
             ));
-            $definition->addTag('kernel.listener', array('event' => 'core.response', 'method' => 'onCoreResponse'));
+            $definition->addTag('kernel.event_listener', array('event' => 'kernel.response', 'method' => 'onKernelResponse'));
             break;
 
         case 'rotating_file':

+ 1 - 1
src/Symfony/Bundle/SecurityBundle/EventListener/ResponseListener.php

@@ -22,7 +22,7 @@ use Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface;
  */
 class ResponseListener
 {
-    public function onCoreResponse(FilterResponseEvent $event)
+    public function onKernelResponse(FilterResponseEvent $event)
     {
         $request = $event->getRequest();
         $response = $event->getResponse();

+ 1 - 1
src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml

@@ -98,7 +98,7 @@
 
         <!-- Firewall related services -->
         <service id="security.firewall" class="%security.firewall.class%">
-            <tag name="kernel.listener" event="core.request" method="onCoreRequest" priority="64" />
+            <tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" priority="64" />
             <argument type="service" id="security.firewall.map" />
             <argument type="service" id="event_dispatcher" />
         </service>

+ 1 - 1
src/Symfony/Bundle/SecurityBundle/Resources/config/security_rememberme.xml

@@ -54,7 +54,7 @@
         </service>
 
         <service id="security.rememberme.response_listener" class="%security.rememberme.response_listener.class%">
-            <tag name="kernel.listener" event="core.response" method="onCoreResponse" />
+            <tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse" />
         </service>
     </services>
 

+ 2 - 2
src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php

@@ -20,7 +20,7 @@ use Symfony\Bundle\TwigBundle\TwigEngine;
 /**
  * WebDebugToolbarListener injects the Web Debug Toolbar.
  *
- * The handle method must be connected to the onCoreResponse event.
+ * The onKernelResponse method must be connected to the kernel.response event.
  *
  * The WDT is only injected on well-formed HTML (with a proper </body> tag).
  * This means that the WDT is never included in sub-requests or ESI requests.
@@ -45,7 +45,7 @@ class WebDebugToolbarListener
         return $this->verbose;
     }
 
-    public function onCoreResponse(FilterResponseEvent $event)
+    public function onKernelResponse(FilterResponseEvent $event)
     {
         if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
             return;

+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Resources/config/toolbar.xml

@@ -10,7 +10,7 @@
 
     <services>
         <service id="web_profiler.debug_toolbar" class="%web_profiler.debug_toolbar.class%">
-            <tag name="kernel.listener" event="core.response" method="onCoreResponse" priority="-128" />
+            <tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse" priority="-128" />
             <argument type="service" id="templating.engine.twig" />
             <argument>%web_profiler.debug_toolbar.intercept_redirects%</argument>
             <argument>%web_profiler.debug_toolbar.verbose%</argument>

+ 8 - 8
src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php

@@ -59,7 +59,7 @@ class WebDebugToolbarListenerTest extends \PHPUnit_Framework_TestCase
             $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, $response);
 
             $listener = new WebDebugToolbarListener($this->getTemplatingMock('Redirection'), true);
-            $listener->onCoreResponse($event);
+            $listener->onKernelResponse($event);
 
             $this->assertEquals(200, $response->getStatusCode());
             $this->assertEquals('Redirection', $response->getContent());
@@ -74,7 +74,7 @@ class WebDebugToolbarListenerTest extends \PHPUnit_Framework_TestCase
         $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, $response);
 
         $listener = new WebDebugToolbarListener($this->getTemplatingMock());
-        $listener->onCoreResponse($event);
+        $listener->onKernelResponse($event);
 
         $this->assertEquals("<html><head></head><body>\nWDT\n</body></html>", $response->getContent());
     }
@@ -90,7 +90,7 @@ class WebDebugToolbarListenerTest extends \PHPUnit_Framework_TestCase
             $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, $response);
 
             $listener = new WebDebugToolbarListener($this->getTemplatingMock());
-            $listener->onCoreResponse($event);
+            $listener->onKernelResponse($event);
 
             $this->assertEquals('<html><head></head><body></body></html>', $response->getContent());
         }
@@ -106,7 +106,7 @@ class WebDebugToolbarListenerTest extends \PHPUnit_Framework_TestCase
         $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, $response);
 
         $listener = new WebDebugToolbarListener($this->getTemplatingMock());
-        $listener->onCoreResponse($event);
+        $listener->onKernelResponse($event);
 
         $this->assertEquals('<html><head></head><body></body></html>', $response->getContent());
     }
@@ -122,7 +122,7 @@ class WebDebugToolbarListenerTest extends \PHPUnit_Framework_TestCase
         $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::SUB_REQUEST, $response);
 
         $listener = new WebDebugToolbarListener($this->getTemplatingMock());
-        $listener->onCoreResponse($event);
+        $listener->onKernelResponse($event);
 
         $this->assertEquals('<html><head></head><body></body></html>', $response->getContent());
     }
@@ -138,7 +138,7 @@ class WebDebugToolbarListenerTest extends \PHPUnit_Framework_TestCase
         $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, $response);
 
         $listener = new WebDebugToolbarListener($this->getTemplatingMock());
-        $listener->onCoreResponse($event);
+        $listener->onKernelResponse($event);
 
         $this->assertEquals('<div>Some content</div>', $response->getContent());
     }
@@ -154,7 +154,7 @@ class WebDebugToolbarListenerTest extends \PHPUnit_Framework_TestCase
         $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(true), HttpKernelInterface::MASTER_REQUEST, $response);
 
         $listener = new WebDebugToolbarListener($this->getTemplatingMock());
-        $listener->onCoreResponse($event);
+        $listener->onKernelResponse($event);
 
         $this->assertEquals('<html><head></head><body></body></html>', $response->getContent());
     }
@@ -170,7 +170,7 @@ class WebDebugToolbarListenerTest extends \PHPUnit_Framework_TestCase
         $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(false, 'json'), HttpKernelInterface::MASTER_REQUEST, $response);
 
         $listener = new WebDebugToolbarListener($this->getTemplatingMock());
-        $listener->onCoreResponse($event);
+        $listener->onKernelResponse($event);
 
         $this->assertEquals('<html><head></head><body></body></html>', $response->getContent());
     }

+ 1 - 1
src/Symfony/Component/HttpKernel/EventListener/EsiListener.php

@@ -41,7 +41,7 @@ class EsiListener
      *
      * @param FilterResponseEvent $event A FilterResponseEvent instance
      */
-    public function onCoreResponse(FilterResponseEvent $event)
+    public function onKernelResponse(FilterResponseEvent $event)
     {
         if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType() || null === $this->esi) {
             return;

+ 1 - 1
src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php

@@ -35,7 +35,7 @@ class ExceptionListener
         $this->logger = $logger;
     }
 
-    public function onCoreException(GetResponseForExceptionEvent $event)
+    public function onKernelException(GetResponseForExceptionEvent $event)
     {
         static $handling;
 

+ 5 - 5
src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php

@@ -20,7 +20,7 @@ use Symfony\Component\HttpKernel\Profiler\Profiler;
 use Symfony\Component\HttpFoundation\RequestMatcherInterface;
 
 /**
- * ProfilerListener collects data for the current request by listening to the onCoreResponse event.
+ * ProfilerListener collects data for the current request by listening to the onKernelResponse event.
  *
  * @author Fabien Potencier <fabien@symfony.com>
  */
@@ -51,11 +51,11 @@ class ProfilerListener
     }
 
     /**
-     * Handles the onCoreException event.
+     * Handles the onKernelException event.
      *
      * @param GetResponseForExceptionEvent $event A GetResponseForExceptionEvent instance
      */
-    public function onCoreException(GetResponseForExceptionEvent $event)
+    public function onKernelException(GetResponseForExceptionEvent $event)
     {
         if ($this->onlyMasterRequests && HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
             return;
@@ -65,11 +65,11 @@ class ProfilerListener
     }
 
     /**
-     * Handles the onCoreResponse event.
+     * Handles the onKernelResponse event.
      *
      * @param FilterResponseEvent $event A FilterResponseEvent instance
      */
-    public function onCoreResponse(FilterResponseEvent $event)
+    public function onKernelResponse(FilterResponseEvent $event)
     {
         $master = HttpKernelInterface::MASTER_REQUEST === $event->getRequestType();
         if ($this->onlyMasterRequests && !$master) {

+ 1 - 1
src/Symfony/Component/HttpKernel/EventListener/ResponseListener.php

@@ -34,7 +34,7 @@ class ResponseListener
      *
      * @param FilterResponseEvent $event    A FilterResponseEvent instance
      */
-    public function onCoreResponse(FilterResponseEvent $event)
+    public function onKernelResponse(FilterResponseEvent $event)
     {
         $request = $event->getRequest();
         $response = $event->getResponse();

+ 5 - 5
src/Symfony/Component/HttpKernel/HttpKernel.php

@@ -89,7 +89,7 @@ class HttpKernel implements HttpKernelInterface
     {
         // request
         $event = new GetResponseEvent($this, $request, $type);
-        $this->dispatcher->dispatch(CoreEvents::REQUEST, $event);
+        $this->dispatcher->dispatch(KernelEvents::REQUEST, $event);
 
         if ($event->hasResponse()) {
             return $this->filterResponse($event->getResponse(), $request, $type);
@@ -101,7 +101,7 @@ class HttpKernel implements HttpKernelInterface
         }
 
         $event = new FilterControllerEvent($this, $controller, $request, $type);
-        $this->dispatcher->dispatch(CoreEvents::CONTROLLER, $event);
+        $this->dispatcher->dispatch(KernelEvents::CONTROLLER, $event);
         $controller = $event->getController();
 
         // controller arguments
@@ -113,7 +113,7 @@ class HttpKernel implements HttpKernelInterface
         // view
         if (!$response instanceof Response) {
             $event = new GetResponseForControllerResultEvent($this, $request, $type, $response);
-            $this->dispatcher->dispatch(CoreEvents::VIEW, $event);
+            $this->dispatcher->dispatch(KernelEvents::VIEW, $event);
 
             if ($event->hasResponse()) {
                 $response = $event->getResponse();
@@ -148,7 +148,7 @@ class HttpKernel implements HttpKernelInterface
     {
         $event = new FilterResponseEvent($this, $request, $type, $response);
 
-        $this->dispatcher->dispatch(CoreEvents::RESPONSE, $event);
+        $this->dispatcher->dispatch(KernelEvents::RESPONSE, $event);
 
         return $event->getResponse();
     }
@@ -165,7 +165,7 @@ class HttpKernel implements HttpKernelInterface
     private function handleException(\Exception $e, $request, $type)
     {
         $event = new GetResponseForExceptionEvent($this, $request, $type, $e);
-        $this->dispatcher->dispatch(CoreEvents::EXCEPTION, $event);
+        $this->dispatcher->dispatch(KernelEvents::EXCEPTION, $event);
 
         if (!$event->hasResponse()) {
             throw $e;

+ 6 - 6
src/Symfony/Component/HttpKernel/CoreEvents.php

@@ -16,7 +16,7 @@ namespace Symfony\Component\HttpKernel;
  *
  * @author Bernhard Schussek <bernhard.schussek@symfony.com>
  */
-final class CoreEvents
+final class KernelEvents
 {
     /**
      * The REQUEST event occurs at the very beginning of request
@@ -29,7 +29,7 @@ final class CoreEvents
      *
      * @var string
      */
-    const REQUEST = 'core.request';
+    const REQUEST = 'kernel.request';
 
     /**
      * The EXCEPTION event occurs when an uncaught exception appears
@@ -41,7 +41,7 @@ final class CoreEvents
      *
      * @var string
      */
-    const EXCEPTION = 'core.exception';
+    const EXCEPTION = 'kernel.exception';
 
     /**
      * The VIEW event occurs when the return value of a controller
@@ -54,7 +54,7 @@ final class CoreEvents
      *
      * @var string
      */
-    const VIEW = 'core.view';
+    const VIEW = 'kernel.view';
 
     /**
      * The CONTROLLER event occurs once a controller was found for
@@ -66,7 +66,7 @@ final class CoreEvents
      *
      * @var string
      */
-    const CONTROLLER = 'core.controller';
+    const CONTROLLER = 'kernel.controller';
 
     /**
      * The RESPONSE event occurs once a response was created for
@@ -78,5 +78,5 @@ final class CoreEvents
      *
      * @var string
      */
-    const RESPONSE = 'core.response';
+    const RESPONSE = 'kernel.response';
 }

+ 1 - 1
src/Symfony/Component/Security/Http/Firewall.php

@@ -50,7 +50,7 @@ class Firewall
      *
      * @param GetResponseEvent $event An GetResponseEvent instance
      */
-    public function onCoreRequest(GetResponseEvent $event)
+    public function onKernelRequest(GetResponseEvent $event)
     {
         if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
             return;

+ 0 - 1
src/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.php

@@ -21,7 +21,6 @@ use Symfony\Component\Security\Core\Exception\AuthenticationException;
 use Symfony\Component\Security\Core\Exception\SessionUnavailableException;
 use Symfony\Component\HttpKernel\Log\LoggerInterface;
 use Symfony\Component\HttpKernel\HttpKernelInterface;
-use Symfony\Component\HttpKernel\CoreEvents;
 use Symfony\Component\HttpKernel\Event\GetResponseEvent;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;

+ 0 - 1
src/Symfony/Component/Security/Http/Firewall/AbstractPreAuthenticatedListener.php

@@ -18,7 +18,6 @@ use Symfony\Component\Security\Core\Exception\AuthenticationException;
 use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
 use Symfony\Component\Security\Http\SecurityEvents;
 use Symfony\Component\HttpKernel\Event\GetResponseEvent;
-use Symfony\Component\HttpKernel\CoreEvents;
 use Symfony\Component\HttpKernel\Log\LoggerInterface;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\EventDispatcher\EventDispatcherInterface;

+ 3 - 3
src/Symfony/Component/Security/Http/Firewall/ContextListener.php

@@ -16,7 +16,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface;
 use Symfony\Component\HttpKernel\Log\LoggerInterface;
 use Symfony\Component\HttpKernel\Event\GetResponseEvent;
 use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
-use Symfony\Component\HttpKernel\CoreEvents;
+use Symfony\Component\HttpKernel\KernelEvents;
 use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
 use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
 use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
@@ -50,7 +50,7 @@ class ContextListener implements ListenerInterface
         $this->logger = $logger;
 
         if (null !== $dispatcher) {
-            $dispatcher->addListener(CoreEvents::RESPONSE, array($this, 'onCoreResponse'));
+            $dispatcher->addListener(KernelEvents::RESPONSE, array($this, 'onKernelResponse'));
         }
     }
 
@@ -87,7 +87,7 @@ class ContextListener implements ListenerInterface
      *
      * @param FilterResponseEvent $event A FilterResponseEvent instance
      */
-    public function onCoreResponse(FilterResponseEvent $event)
+    public function onKernelResponse(FilterResponseEvent $event)
     {
         if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
             return;

+ 4 - 4
src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php

@@ -23,7 +23,7 @@ use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
 use Symfony\Component\Security\Core\Exception\InsufficientAuthenticationException;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\HttpKernelInterface;
-use Symfony\Component\HttpKernel\CoreEvents;
+use Symfony\Component\HttpKernel\KernelEvents;
 use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
 use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 
@@ -53,13 +53,13 @@ class ExceptionListener
     }
 
     /**
-     * Registers a onCoreException listener to take care of security exceptions.
+     * Registers a onKernelException listener to take care of security exceptions.
      *
      * @param EventDispatcherInterface $dispatcher An EventDispatcherInterface instance
      */
     public function register(EventDispatcherInterface $dispatcher)
     {
-        $dispatcher->addListener(CoreEvents::EXCEPTION, array($this, 'onCoreException'));
+        $dispatcher->addListener(KernelEvents::EXCEPTION, array($this, 'onKernelException'));
     }
 
     /**
@@ -67,7 +67,7 @@ class ExceptionListener
      *
      * @param GetResponseForExceptionEvent $event An GetResponseForExceptionEvent instance
      */
-    public function onCoreException(GetResponseForExceptionEvent $event)
+    public function onKernelException(GetResponseForExceptionEvent $event)
     {
         $exception = $event->getException();
         $request = $event->getRequest();

+ 0 - 1
src/Symfony/Component/Security/Http/Firewall/RememberMeListener.php

@@ -6,7 +6,6 @@ use Symfony\Component\HttpKernel\HttpKernelInterface;
 use Symfony\Component\HttpKernel\Log\LoggerInterface;
 use Symfony\Component\HttpKernel\Event\GetResponseEvent;
 use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
-use Symfony\Component\HttpKernel\CoreEvents;
 use Symfony\Component\HttpFoundation\Response;
 use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
 use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;

+ 7 - 7
tests/Symfony/Tests/Component/HttpKernel/EventListener/EsiListenerTest.php

@@ -14,7 +14,7 @@ namespace Symfony\Tests\Component\HttpKernel\EventListener;
 use Symfony\Component\HttpKernel\HttpCache\Esi;
 use Symfony\Component\HttpKernel\EventListener\EsiListener;
 use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
-use Symfony\Component\HttpKernel\CoreEvents;
+use Symfony\Component\HttpKernel\KernelEvents;
 use Symfony\Component\HttpKernel\HttpKernelInterface;
 use Symfony\Component\HttpFoundation\Response;
 use Symfony\Component\HttpFoundation\Request;
@@ -29,9 +29,9 @@ class EsiListenerTest extends \PHPUnit_Framework_TestCase
         $response = new Response('foo <esi:include src="" />');
         $listener = new EsiListener(new Esi());
 
-        $dispatcher->addListener(CoreEvents::RESPONSE, array($listener, 'onCoreResponse'));
+        $dispatcher->addListener(KernelEvents::RESPONSE, array($listener, 'onKernelResponse'));
         $event = new FilterResponseEvent($kernel, new Request(), HttpKernelInterface::SUB_REQUEST, $response);
-        $dispatcher->dispatch(CoreEvents::RESPONSE, $event);
+        $dispatcher->dispatch(KernelEvents::RESPONSE, $event);
 
         $this->assertEquals('', $event->getResponse()->headers->get('Surrogate-Control'));
     }
@@ -43,9 +43,9 @@ class EsiListenerTest extends \PHPUnit_Framework_TestCase
         $response = new Response('foo <esi:include src="" />');
         $listener = new EsiListener(new Esi());
 
-        $dispatcher->addListener(CoreEvents::RESPONSE, array($listener, 'onCoreResponse'));
+        $dispatcher->addListener(KernelEvents::RESPONSE, array($listener, 'onKernelResponse'));
         $event = new FilterResponseEvent($kernel, new Request(), HttpKernelInterface::MASTER_REQUEST, $response);
-        $dispatcher->dispatch(CoreEvents::RESPONSE, $event);
+        $dispatcher->dispatch(KernelEvents::RESPONSE, $event);
 
         $this->assertEquals('content="ESI/1.0"', $event->getResponse()->headers->get('Surrogate-Control'));
     }
@@ -57,9 +57,9 @@ class EsiListenerTest extends \PHPUnit_Framework_TestCase
         $response = new Response('foo');
         $listener = new EsiListener(new Esi());
 
-        $dispatcher->addListener(CoreEvents::RESPONSE, array($listener, 'onCoreResponse'));
+        $dispatcher->addListener(KernelEvents::RESPONSE, array($listener, 'onKernelResponse'));
         $event = new FilterResponseEvent($kernel, new Request(), HttpKernelInterface::MASTER_REQUEST, $response);
-        $dispatcher->dispatch(CoreEvents::RESPONSE, $event);
+        $dispatcher->dispatch(KernelEvents::RESPONSE, $event);
 
         $this->assertEquals('', $event->getResponse()->headers->get('Surrogate-Control'));
     }

+ 4 - 4
tests/Symfony/Tests/Component/HttpKernel/EventListener/ExceptionListenerTest.php

@@ -49,12 +49,12 @@ class ExceptionListenerTest extends \PHPUnit_Framework_TestCase
         $errorLog = ini_set('error_log', file_exists('/dev/null') ? '/dev/null' : 'nul');
 
         $l = new ExceptionListener('foo');
-        $l->onCoreException($event);
+        $l->onKernelException($event);
 
         $this->assertEquals(new Response('foo'), $event->getResponse());
 
         try {
-            $l->onCoreException($event2);
+            $l->onKernelException($event2);
         } catch(\Exception $e) {
             $this->assertSame('foo', $e->getMessage());
         }
@@ -71,12 +71,12 @@ class ExceptionListenerTest extends \PHPUnit_Framework_TestCase
         $logger = new TestLogger();
 
         $l = new ExceptionListener('foo', $logger);
-        $l->onCoreException($event);
+        $l->onKernelException($event);
 
         $this->assertEquals(new Response('foo'), $event->getResponse());
 
         try {
-            $l->onCoreException($event2);
+            $l->onKernelException($event2);
         } catch(\Exception $e) {
             $this->assertSame('foo', $e->getMessage());
         }

+ 13 - 13
tests/Symfony/Tests/Component/HttpKernel/EventListener/ResponseListenerTest.php

@@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
 use Symfony\Component\HttpKernel\HttpKernelInterface;
 use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
-use Symfony\Component\HttpKernel\CoreEvents;
+use Symfony\Component\HttpKernel\KernelEvents;
 use Symfony\Component\EventDispatcher\EventDispatcher;
 
 class ResponseListenerTest extends \PHPUnit_Framework_TestCase
@@ -29,7 +29,7 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase
     {
         $this->dispatcher = new EventDispatcher();
         $listener = new ResponseListener('UTF-8');
-        $this->dispatcher->addListener(CoreEvents::RESPONSE, array($listener, 'onCoreResponse'));
+        $this->dispatcher->addListener(KernelEvents::RESPONSE, array($listener, 'onKernelResponse'));
 
         $this->kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
 
@@ -46,7 +46,7 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase
         $response = new Response('foo');
 
         $event = new FilterResponseEvent($this->kernel, new Request(), HttpKernelInterface::SUB_REQUEST, $response);
-        $this->dispatcher->dispatch(CoreEvents::RESPONSE, $event);
+        $this->dispatcher->dispatch(KernelEvents::RESPONSE, $event);
 
         $this->assertEquals('', $event->getResponse()->headers->get('content-type'));
     }
@@ -57,7 +57,7 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase
         $response->headers->set('Content-Type', 'text/plain');
 
         $event = new FilterResponseEvent($this->kernel, new Request(), HttpKernelInterface::MASTER_REQUEST, $response);
-        $this->dispatcher->dispatch(CoreEvents::RESPONSE, $event);
+        $this->dispatcher->dispatch(KernelEvents::RESPONSE, $event);
 
         $this->assertEquals('text/plain', $event->getResponse()->headers->get('content-type'));
     }
@@ -67,7 +67,7 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase
         $response = new Response('foo');
 
         $event = new FilterResponseEvent($this->kernel, Request::create('/'), HttpKernelInterface::MASTER_REQUEST, $response);
-        $this->dispatcher->dispatch(CoreEvents::RESPONSE, $event);
+        $this->dispatcher->dispatch(KernelEvents::RESPONSE, $event);
 
         $this->assertEquals('text/html', $event->getResponse()->headers->get('content-type'));
     }
@@ -79,7 +79,7 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase
         $request->setRequestFormat('json');
 
         $event = new FilterResponseEvent($this->kernel, $request, HttpKernelInterface::MASTER_REQUEST, $response);
-        $this->dispatcher->dispatch(CoreEvents::RESPONSE, $event);
+        $this->dispatcher->dispatch(KernelEvents::RESPONSE, $event);
 
         $this->assertEquals('application/json', $event->getResponse()->headers->get('content-type'));
     }
@@ -90,7 +90,7 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase
         $request = Request::create('/', 'HEAD');
 
         $event = new FilterResponseEvent($this->kernel, $request, HttpKernelInterface::MASTER_REQUEST, $response);
-        $this->dispatcher->dispatch(CoreEvents::RESPONSE, $event);
+        $this->dispatcher->dispatch(KernelEvents::RESPONSE, $event);
 
         $this->assertEquals('', $response->getContent());
     }
@@ -98,12 +98,12 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase
     public function testFilterSetsNonDefaultCharsetIfNotOverridden()
     {
         $listener = new ResponseListener('ISO-8859-15');
-        $this->dispatcher->addListener(CoreEvents::RESPONSE, array($listener, 'onCoreResponse'), 1);
+        $this->dispatcher->addListener(KernelEvents::RESPONSE, array($listener, 'onKernelResponse'), 1);
 
         $response = new Response('foo');
 
         $event = new FilterResponseEvent($this->kernel, Request::create('/'), HttpKernelInterface::MASTER_REQUEST, $response);
-        $this->dispatcher->dispatch(CoreEvents::RESPONSE, $event);
+        $this->dispatcher->dispatch(KernelEvents::RESPONSE, $event);
 
         $this->assertEquals('ISO-8859-15', $response->getCharset());
     }
@@ -111,13 +111,13 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase
     public function testFilterDoesNothingIfCharsetIsOverridden()
     {
         $listener = new ResponseListener('ISO-8859-15');
-        $this->dispatcher->addListener(CoreEvents::RESPONSE, array($listener, 'onCoreResponse'), 1);
+        $this->dispatcher->addListener(KernelEvents::RESPONSE, array($listener, 'onKernelResponse'), 1);
 
         $response = new Response('foo');
         $response->setCharset('ISO-8859-1');
 
         $event = new FilterResponseEvent($this->kernel, Request::create('/'), HttpKernelInterface::MASTER_REQUEST, $response);
-        $this->dispatcher->dispatch(CoreEvents::RESPONSE, $event);
+        $this->dispatcher->dispatch(KernelEvents::RESPONSE, $event);
 
         $this->assertEquals('ISO-8859-1', $response->getCharset());
     }
@@ -125,14 +125,14 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase
     public function testFiltersSetsNonDefaultCharsetIfNotOverriddenOnNonTextContentType()
     {
         $listener = new ResponseListener('ISO-8859-15');
-        $this->dispatcher->addListener(CoreEvents::RESPONSE, array($listener, 'onCoreResponse'), 1);
+        $this->dispatcher->addListener(KernelEvents::RESPONSE, array($listener, 'onKernelResponse'), 1);
 
         $response = new Response('foo');
         $request = Request::create('/');
         $request->setRequestFormat('application/json');
 
         $event = new FilterResponseEvent($this->kernel, $request, HttpKernelInterface::MASTER_REQUEST, $response);
-        $this->dispatcher->dispatch(CoreEvents::RESPONSE, $event);
+        $this->dispatcher->dispatch(KernelEvents::RESPONSE, $event);
 
         $this->assertEquals('ISO-8859-15', $response->getCharset());
     }

+ 5 - 5
tests/Symfony/Tests/Component/HttpKernel/HttpKernelTest.php

@@ -13,7 +13,7 @@ namespace Symfony\Tests\Component\HttpKernel;
 
 use Symfony\Component\HttpKernel\HttpKernel;
 use Symfony\Component\HttpKernel\HttpKernelInterface;
-use Symfony\Component\HttpKernel\CoreEvents;
+use Symfony\Component\HttpKernel\KernelEvents;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
 use Symfony\Component\EventDispatcher\EventDispatcher;
@@ -43,7 +43,7 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase
     public function testHandleWhenControllerThrowsAnExceptionAndRawIsFalse()
     {
         $dispatcher = new EventDispatcher();
-        $dispatcher->addListener(CoreEvents::EXCEPTION, function ($event)
+        $dispatcher->addListener(KernelEvents::EXCEPTION, function ($event)
         {
             $event->setResponse(new Response($event->getException()->getMessage()));
         });
@@ -56,7 +56,7 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase
     public function testHandleWhenAListenerReturnsAResponse()
     {
         $dispatcher = new EventDispatcher();
-        $dispatcher->addListener(CoreEvents::REQUEST, function ($event)
+        $dispatcher->addListener(KernelEvents::REQUEST, function ($event)
         {
             $event->setResponse(new Response('hello'));
         });
@@ -143,7 +143,7 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase
     public function testHandleWhenTheControllerDoesNotReturnAResponseButAViewIsRegistered()
     {
         $dispatcher = new EventDispatcher();
-        $dispatcher->addListener(CoreEvents::VIEW, function ($event)
+        $dispatcher->addListener(KernelEvents::VIEW, function ($event)
         {
             $event->setResponse(new Response($event->getControllerResult()));
         });
@@ -155,7 +155,7 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase
     public function testHandleWithAResponseListener()
     {
         $dispatcher = new EventDispatcher();
-        $dispatcher->addListener(CoreEvents::RESPONSE, function ($event)
+        $dispatcher->addListener(KernelEvents::RESPONSE, function ($event)
         {
             $event->setResponse(new Response('foo'));
         });