adapted merge to 2.5

This commit is contained in:
Fabien Potencier 2015-01-03 11:28:05 +01:00
parent b1819d4498
commit 27176d9b3d
2 changed files with 2 additions and 3 deletions

View File

@ -13,7 +13,6 @@ namespace Symfony\Component\Security\Http\RememberMe;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/** /**
@ -28,7 +27,7 @@ class ResponseListener implements EventSubscriberInterface
*/ */
public function onKernelResponse(FilterResponseEvent $event) public function onKernelResponse(FilterResponseEvent $event)
{ {
if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { if (!$event->isMasterRequest()) {
return; return;
} }

View File

@ -94,7 +94,7 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase
->getMock(); ->getMock();
$event->expects($this->any())->method('getRequest')->will($this->returnValue($request)); $event->expects($this->any())->method('getRequest')->will($this->returnValue($request));
$event->expects($this->any())->method('getRequestType')->will($this->returnValue($type)); $event->expects($this->any())->method('isMasterRequest')->will($this->returnValue($type === HttpKernelInterface::MASTER_REQUEST));
$event->expects($this->any())->method('getResponse')->will($this->returnValue($response)); $event->expects($this->any())->method('getResponse')->will($this->returnValue($response));
return $event; return $event;