diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2016-08-25 10:52:51 -0700 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2016-08-25 10:52:51 -0700 |
commit | 66a4782ddd0539e1b4f2ae2b4058a04af5d21aab (patch) | |
tree | 22eedb3c88bced88bb33694aa8b3241c54c43133 /Http/Tests/Authentication | |
parent | cecc07439a8f0d2125df9726b99746d1897ee2ea (diff) | |
parent | 4e5617e91397d1a8fe5a26bf3fef479f456e3b27 (diff) | |
download | symfony-security-66a4782ddd0539e1b4f2ae2b4058a04af5d21aab.zip symfony-security-66a4782ddd0539e1b4f2ae2b4058a04af5d21aab.tar.gz symfony-security-66a4782ddd0539e1b4f2ae2b4058a04af5d21aab.tar.bz2 |
minor #19736 [FrameworkBundle][Security] Remove useless mocks (Ener-Getick)v2.7.17
This PR was merged into the 2.7 branch.
Discussion
----------
[FrameworkBundle][Security] Remove useless mocks
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Removes mocks causing issues in https://github.com/symfony/symfony/pull/19734.
Commits
-------
fcd3345 [FrameworkBundle][Security] Remove useless mocks
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 82b5533..252b124 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 @@ -52,7 +53,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)); @@ -65,7 +66,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 4d1847d..ae9f02b 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 @@ -157,8 +158,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() |