summaryrefslogtreecommitdiffstats
path: root/Tests/Http/Firewall
diff options
context:
space:
mode:
authorAlexander <iam.asm89@gmail.com>2012-07-14 16:07:08 +0200
committerAlexander <iam.asm89@gmail.com>2012-07-14 16:07:08 +0200
commitb8e351355dbba100f7da975f31e9a6a73146b61a (patch)
treeb2a671e17f0c3e467d61849df4132ddc999efd31 /Tests/Http/Firewall
parent46e7e6cf5307d8d336a08f0bc10f4d503602ecf8 (diff)
downloadsymfony-security-b8e351355dbba100f7da975f31e9a6a73146b61a.zip
symfony-security-b8e351355dbba100f7da975f31e9a6a73146b61a.tar.gz
symfony-security-b8e351355dbba100f7da975f31e9a6a73146b61a.tar.bz2
[Security] Extract default logout success handling logic
Diffstat (limited to 'Tests/Http/Firewall')
-rw-r--r--Tests/Http/Firewall/LogoutListenerTest.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/Tests/Http/Firewall/LogoutListenerTest.php b/Tests/Http/Firewall/LogoutListenerTest.php
index 6ffeed9..aa0f5a7 100644
--- a/Tests/Http/Firewall/LogoutListenerTest.php
+++ b/Tests/Http/Firewall/LogoutListenerTest.php
@@ -103,7 +103,9 @@ class LogoutListenerTest extends \PHPUnit_Framework_TestCase
public function testHandleMatchedPathWithoutSuccessHandlerAndCsrfValidation()
{
- list($listener, $context, $httpUtils, $options) = $this->getListener();
+ $successHandler = $this->getSuccessHandler();
+
+ list($listener, $context, $httpUtils, $options) = $this->getListener($successHandler);
list($event, $request) = $this->getGetResponseEvent();
@@ -112,9 +114,9 @@ class LogoutListenerTest extends \PHPUnit_Framework_TestCase
->with($request, $options['logout_path'])
->will($this->returnValue(true));
- $httpUtils->expects($this->once())
- ->method('createRedirectResponse')
- ->with($request, $options['target_url'])
+ $successHandler->expects($this->once())
+ ->method('onLogoutSuccess')
+ ->with($request)
->will($this->returnValue($response = new Response()));
$context->expects($this->once())
@@ -231,13 +233,13 @@ class LogoutListenerTest extends \PHPUnit_Framework_TestCase
$listener = new LogoutListener(
$context = $this->getContext(),
$httpUtils = $this->getHttpUtils(),
+ $successHandler ?: $this->getSuccessHandler(),
$options = array(
'csrf_parameter' => '_csrf_token',
'intention' => 'logout',
'logout_path' => '/logout',
'target_url' => '/',
),
- $successHandler,
$csrfProvider
);