Skip to content

Commit 33a6d37

Browse files
committed
Use import instead of FQCN
1 parent a6efb4c commit 33a6d37

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Tests/Authentication/Provider/PreAuthenticatedAuthenticationProviderTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\Security\Core\Authentication\Provider\PreAuthenticatedAuthenticationProvider;
16+
use Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken;
1617
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1718
use Symfony\Component\Security\Core\Exception\AuthenticationException;
1819
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
@@ -30,7 +31,7 @@ public function testSupports()
3031
$this->assertTrue($provider->supports($this->getSupportedToken()));
3132
$this->assertFalse($provider->supports($this->createMock(TokenInterface::class)));
3233

33-
$token = $this->createMock(\Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken::class);
34+
$token = $this->createMock(PreAuthenticatedToken::class);
3435
$token
3536
->expects($this->once())
3637
->method('getProviderKey')
@@ -66,7 +67,7 @@ public function testAuthenticate()
6667
$provider = $this->getProvider($user);
6768

6869
$token = $provider->authenticate($this->getSupportedToken('fabien', 'pass'));
69-
$this->assertInstanceOf(\Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken::class, $token);
70+
$this->assertInstanceOf(PreAuthenticatedToken::class, $token);
7071
$this->assertEquals('pass', $token->getCredentials());
7172
$this->assertEquals('key', $token->getProviderKey());
7273
$this->assertEquals([], $token->getRoleNames());
@@ -92,7 +93,7 @@ public function testAuthenticateWhenUserCheckerThrowsException()
9293

9394
protected function getSupportedToken($user = false, $credentials = false)
9495
{
95-
$token = $this->getMockBuilder(\Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken::class)->setMethods(['getUser', 'getCredentials', 'getProviderKey'])->disableOriginalConstructor()->getMock();
96+
$token = $this->getMockBuilder(PreAuthenticatedToken::class)->setMethods(['getUser', 'getCredentials', 'getProviderKey'])->disableOriginalConstructor()->getMock();
9697
if (false !== $user) {
9798
$token->expects($this->once())
9899
->method('getUser')

0 commit comments

Comments
 (0)