minor #39931 Use class const in test (OskarStark)

This PR was merged into the 5.1 branch.

Discussion
----------

Use class const in test

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | ---
| License       | MIT
| Doc PR        | ---

super minor, same as #39930, but for `5.1`

I will finish this PR after #39930 is merged and upmerged

Commits
-------

4a98eeecdc [Security] [HttpFoundation] Use class const in test
This commit is contained in:
Jérémy Derussé 2021-01-22 11:24:07 +01:00
commit 26452260ed
No known key found for this signature in database
GPG Key ID: 2083FA5758C473D2
2 changed files with 4 additions and 2 deletions

View File

@ -13,6 +13,7 @@ namespace Symfony\Component\Security\Http\Tests\Authenticator;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
use Symfony\Component\Security\Core\Security;
@ -165,7 +166,7 @@ class FormLoginAuthenticatorTest extends TestCase
private function createSession()
{
return $this->createMock('Symfony\Component\HttpFoundation\Session\SessionInterface');
return $this->createMock(SessionInterface::class);
}
}

View File

@ -19,6 +19,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\Security\Http\Event\LogoutEvent;
use Symfony\Component\Security\Http\Firewall\LogoutListener;
use Symfony\Component\Security\Http\Logout\LogoutHandlerInterface;
use Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface;
class LogoutListenerTest extends TestCase
@ -183,7 +184,7 @@ class LogoutListenerTest extends TestCase
$response = new Response();
$logoutSuccessHandler->expects($this->any())->method('onLogoutSuccess')->willReturn($response);
$handler = $this->createMock('Symfony\Component\Security\Http\Logout\LogoutHandlerInterface');
$handler = $this->createMock(LogoutHandlerInterface::class);
$handler->expects($this->once())->method('logout')->with($request, $response, $token);
$listener->addHandler($handler);