summaryrefslogtreecommitdiffstats
path: root/Http/Tests/Authentication/DefaultAuthenticationFailureHandlerTest.php
diff options
context:
space:
mode:
authorChristian Flothmann <christian.flothmann@xabbuh.de>2015-04-03 18:13:34 +0200
committerChristian Flothmann <christian.flothmann@xabbuh.de>2015-09-30 09:55:52 +0200
commitd37cee9ea33b5ece6837253a15d83e0740074bba (patch)
tree476021f595a02fa111ccd0b29a38dd61cd14ea6a /Http/Tests/Authentication/DefaultAuthenticationFailureHandlerTest.php
parent889a989997c4b038fb4e354e57e35ede82370581 (diff)
downloadsymfony-security-d37cee9ea33b5ece6837253a15d83e0740074bba.zip
symfony-security-d37cee9ea33b5ece6837253a15d83e0740074bba.tar.gz
symfony-security-d37cee9ea33b5ece6837253a15d83e0740074bba.tar.bz2
deprecate finding deep items in request parameters
Diffstat (limited to 'Http/Tests/Authentication/DefaultAuthenticationFailureHandlerTest.php')
-rw-r--r--Http/Tests/Authentication/DefaultAuthenticationFailureHandlerTest.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/Http/Tests/Authentication/DefaultAuthenticationFailureHandlerTest.php b/Http/Tests/Authentication/DefaultAuthenticationFailureHandlerTest.php
index 82b5533..2ed8872 100644
--- a/Http/Tests/Authentication/DefaultAuthenticationFailureHandlerTest.php
+++ b/Http/Tests/Authentication/DefaultAuthenticationFailureHandlerTest.php
@@ -145,7 +145,7 @@ class DefaultAuthenticationFailureHandlerTest extends \PHPUnit_Framework_TestCas
public function testFailurePathCanBeOverwrittenWithRequest()
{
$this->request->expects($this->once())
- ->method('get')->with('_failure_path', null, true)
+ ->method('get')->with('_failure_path', null, false)
->will($this->returnValue('/auth/login'));
$this->httpUtils->expects($this->once())
@@ -155,12 +155,25 @@ class DefaultAuthenticationFailureHandlerTest extends \PHPUnit_Framework_TestCas
$handler->onAuthenticationFailure($this->request, $this->exception);
}
+ public function testFailurePathCanBeOverwrittenWithNestedAttributeInRequest()
+ {
+ $this->request->expects($this->once())
+ ->method('get')->with('_failure_path', null, false)
+ ->will($this->returnValue(array('value' => '/auth/login')));
+
+ $this->httpUtils->expects($this->once())
+ ->method('createRedirectResponse')->with($this->request, '/auth/login');
+
+ $handler = new DefaultAuthenticationFailureHandler($this->httpKernel, $this->httpUtils, array('failure_path_parameter' => '_failure_path[value]'), $this->logger);
+ $handler->onAuthenticationFailure($this->request, $this->exception);
+ }
+
public function testFailurePathParameterCanBeOverwritten()
{
$options = array('failure_path_parameter' => '_my_failure_path');
$this->request->expects($this->once())
- ->method('get')->with('_my_failure_path', null, true)
+ ->method('get')->with('_my_failure_path', null, false)
->will($this->returnValue('/auth/login'));
$this->httpUtils->expects($this->once())