diff options
author | Nicolas Grekas <nicolas.grekas@gmail.com> | 2016-08-26 14:08:28 +0200 |
---|---|---|
committer | Nicolas Grekas <nicolas.grekas@gmail.com> | 2016-08-26 14:08:28 +0200 |
commit | f57cf66f5b86da93a8b37e74bc431554758f4c31 (patch) | |
tree | 04104712160e8486be7713a95678ee654f49d7b1 /Http/Tests/Authentication | |
parent | 66c4d38328fd1e985067153c76e2238206f97bd8 (diff) | |
parent | 1e647f605f41c2d7a29be9e38365adf85b68b1c9 (diff) | |
download | symfony-security-f57cf66f5b86da93a8b37e74bc431554758f4c31.zip symfony-security-f57cf66f5b86da93a8b37e74bc431554758f4c31.tar.gz symfony-security-f57cf66f5b86da93a8b37e74bc431554758f4c31.tar.bz2 |
Merge branch '3.1'
* 3.1:
fix typo
add "provides" for psr/cache-implementation
[Validator][GroupSequence] fixed GroupSequence validation ignores PropertyMetadata of parent classes
[FrameworkBundle][Security] Remove useless mocks
Add symfony/inflector to composer.json "replaces"
[DoctrineBridge] Enhance exception message in EntityUserProvider
added friendly exception when constraint validator does not exist or it is not enabled
remove duplicate instruction
[FrameworkBundle] Remove TranslatorBagInterface check
[FrameworkBundle] Remove duplicated code in RouterDebugCommand
[Validator] fixed duplicate constraints with parent class interfaces
SecurityBundle:BasicAuthenticationListener: removed a default argument on getting a header value
Diffstat (limited to 'Http/Tests/Authentication')
3 files changed, 7 insertions, 5 deletions
diff --git a/Http/Tests/Authentication/DefaultAuthenticationFailureHandlerTest.php b/Http/Tests/Authentication/DefaultAuthenticationFailureHandlerTest.php index 8f854c8..c97ee69 100644 --- a/Http/Tests/Authentication/DefaultAuthenticationFailureHandlerTest.php +++ b/Http/Tests/Authentication/DefaultAuthenticationFailureHandlerTest.php @@ -13,6 +13,7 @@ namespace Symfony\Component\Security\Http\Tests\Authentication; use Symfony\Component\Security\Http\Authentication\DefaultAuthenticationFailureHandler; use Symfony\Component\Security\Core\Security; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\HttpKernelInterface; class DefaultAuthenticationFailureHandlerTest extends \PHPUnit_Framework_TestCase @@ -47,7 +48,7 @@ class DefaultAuthenticationFailureHandlerTest extends \PHPUnit_Framework_TestCas ->method('createRequest')->with($this->request, '/login') ->will($this->returnValue($subRequest)); - $response = $this->getMock('Symfony\Component\HttpFoundation\Response'); + $response = new Response(); $this->httpKernel->expects($this->once()) ->method('handle')->with($subRequest, HttpKernelInterface::SUB_REQUEST) ->will($this->returnValue($response)); @@ -60,7 +61,7 @@ class DefaultAuthenticationFailureHandlerTest extends \PHPUnit_Framework_TestCas public function testRedirect() { - $response = $this->getMock('Symfony\Component\HttpFoundation\Response'); + $response = new Response(); $this->httpUtils->expects($this->once()) ->method('createRedirectResponse')->with($this->request, '/login') ->will($this->returnValue($response)); diff --git a/Http/Tests/Authentication/DefaultAuthenticationSuccessHandlerTest.php b/Http/Tests/Authentication/DefaultAuthenticationSuccessHandlerTest.php index 2c22da6..5372993 100644 --- a/Http/Tests/Authentication/DefaultAuthenticationSuccessHandlerTest.php +++ b/Http/Tests/Authentication/DefaultAuthenticationSuccessHandlerTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Security\Http\Tests\Authentication; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSuccessHandler; class DefaultAuthenticationSuccessHandlerTest extends \PHPUnit_Framework_TestCase @@ -171,8 +172,7 @@ class DefaultAuthenticationSuccessHandlerTest extends \PHPUnit_Framework_TestCas private function expectRedirectResponse($path) { - $response = $this->getMock('Symfony\Component\HttpFoundation\Response'); - + $response = new Response(); $this->httpUtils->expects($this->once()) ->method('createRedirectResponse') ->with($this->request, $path) diff --git a/Http/Tests/Authentication/SimpleAuthenticationHandlerTest.php b/Http/Tests/Authentication/SimpleAuthenticationHandlerTest.php index 6e79b07..8a31886 100644 --- a/Http/Tests/Authentication/SimpleAuthenticationHandlerTest.php +++ b/Http/Tests/Authentication/SimpleAuthenticationHandlerTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Security\Http\Tests; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Authentication\SimpleAuthenticatorInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface; @@ -41,7 +42,7 @@ class SimpleAuthenticationHandlerTest extends \PHPUnit_Framework_TestCase // No methods are invoked on the exception; we just assert on its class $this->authenticationException = new AuthenticationException(); - $this->response = $this->getMock('Symfony\Component\HttpFoundation\Response'); + $this->response = new Response(); } public function testOnAuthenticationSuccessFallsBackToDefaultHandlerIfSimpleIsNotASuccessHandler() |