summaryrefslogtreecommitdiffstats
path: root/Tests/Http
diff options
context:
space:
mode:
authorGunnar Lium <gunnar@aptoma.com>2013-02-04 10:27:49 +0100
committerGunnar Lium <gunnar@aptoma.com>2013-03-23 15:10:50 +0100
commite39584c65a12697c1e85d811357b6687e06043a5 (patch)
treef419bb9f1111e034ad5c8d5abfc4a644914c1c4f /Tests/Http
parentaa6acbad8d17f7c8fd6ba4c8ff5ea1009ef5738a (diff)
downloadsymfony-security-e39584c65a12697c1e85d811357b6687e06043a5.zip
symfony-security-e39584c65a12697c1e85d811357b6687e06043a5.tar.gz
symfony-security-e39584c65a12697c1e85d811357b6687e06043a5.tar.bz2
[Security] Return 401 when using use_forward for form authentication
Diffstat (limited to 'Tests/Http')
-rw-r--r--Tests/Http/EntryPoint/FormAuthenticationEntryPointTest.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/Tests/Http/EntryPoint/FormAuthenticationEntryPointTest.php b/Tests/Http/EntryPoint/FormAuthenticationEntryPointTest.php
index 1cf2c2d..cbec1bd 100644
--- a/Tests/Http/EntryPoint/FormAuthenticationEntryPointTest.php
+++ b/Tests/Http/EntryPoint/FormAuthenticationEntryPointTest.php
@@ -50,7 +50,7 @@ class FormAuthenticationEntryPointTest extends \PHPUnit_Framework_TestCase
{
$request = $this->getMock('Symfony\Component\HttpFoundation\Request', array(), array(), '', false, false);
$subRequest = $this->getMock('Symfony\Component\HttpFoundation\Request', array(), array(), '', false, false);
- $response = $this->getMock('Symfony\Component\HttpFoundation\Response');
+ $response = new \Symfony\Component\HttpFoundation\Response('', 200);
$httpUtils = $this->getMock('Symfony\Component\Security\Http\HttpUtils');
$httpUtils
@@ -70,6 +70,9 @@ class FormAuthenticationEntryPointTest extends \PHPUnit_Framework_TestCase
$entryPoint = new FormAuthenticationEntryPoint($httpKernel, $httpUtils, '/the/login/path', true);
- $this->assertEquals($response, $entryPoint->start($request));
+ $entryPointResponse = $entryPoint->start($request);
+
+ $this->assertEquals($response, $entryPointResponse);
+ $this->assertEquals(401, $entryPointResponse->headers->get('X-Status-Code'));
}
}