8000 minor #39931 Use class const in test (OskarStark) · symfony/symfony@2645226 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2645226

Browse files
committed
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 ------- 4a98eee [Security] [HttpFoundation] Use class const in test
2 parents ac362e3 + 4a98eee commit 2645226

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Symfony/Component/Security/Http/Tests/Authenticator/FormLoginAuthenticatorTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\HttpFoundation\Request;
16+
use Symfony\Component\HttpFoundation\Session\SessionInterface;
1617
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
1718
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
1819
use Symfony\Component\Security\Core\Security;
@@ -165,7 +166,7 @@ private function setUpAuthenticator(array $options = [])
165166

166167
private function createSession()
167168
{
168-
return $this->createMock('Symfony\Component\HttpFoundation\Session\SessionInterface');
169+
return $this->createMock(SessionInterface::class);
169170
}
170171
}
171172

src/Symfony/Component/Security/Http/Tests/Firewall/LogoutListenerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Symfony\Component\HttpKernel\Event\RequestEvent;
2020
use Symfony\Component\Security\Http\Event\LogoutEvent;
2121
use Symfony\Component\Security\Http\Firewall\LogoutListener;
22+
use Symfony\Component\Security\Http\Logout\LogoutHandlerInterface;
2223
use Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface;
2324

2425
class LogoutListenerTest extends TestCase
@@ -183,7 +184,7 @@ public function testLegacyLogoutHandlers()
183184
$response = new Response();
184185
$logoutSuccessHandler->expects($this->any())->method('onLogoutSuccess')->willReturn($response);
185186

186-
$handler = $this->createMock('Symfony\Component\Security\Http\Logout\LogoutHandlerInterface');
187+
$handler = $this->createMock(LogoutHandlerInterface::class);
187188
$handler->expects($this->once())->method('logout')->with($request, $response, $token);
188189
$listener->addHandler($handler);
189190

0 commit comments

Comments
 (0)
0