Skip to content

Commit 79cd095

Browse files
committed
fix used class after merge
1 parent 98ef1ac commit 79cd095

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Tests/Authentication/AuthenticationUtilsTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
use Symfony\Component\HttpFoundation\Session\Session;
1818
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
1919
use Symfony\Component\Security\Core\Exception\AuthenticationException;
20-
use Symfony\Component\Security\Core\Security;
2120
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
21+
use Symfony\Component\Security\Http\SecurityRequestAttributes;
2222

2323
class AuthenticationUtilsTest extends TestCase
2424
{
2525
public function testLastAuthenticationErrorWhenRequestHasAttribute()
2626
{
2727
$authenticationError = new AuthenticationException();
2828
$request = Request::create('/');
29-
$request->attributes->set(Security::AUTHENTICATION_ERROR, $authenticationError);
29+
$request->attributes->set(SecurityRequestAttributes::AUTHENTICATION_ERROR, $authenticationError);
3030

3131
$requestStack = new RequestStack();
3232
$requestStack->push($request);
@@ -42,15 +42,15 @@ public function testLastAuthenticationErrorInSession()
4242
$request = Request::create('/');
4343

4444
$session = new Session(new MockArraySessionStorage());
45-
$session->set(Security::AUTHENTICATION_ERROR, $authenticationError);
45+
$session->set(SecurityRequestAttributes::AUTHENTICATION_ERROR, $authenticationError);
4646
$request->setSession($session);
4747

4848
$requestStack = new RequestStack();
4949
$requestStack->push($request);
5050

5151
$utils = new AuthenticationUtils($requestStack);
5252
$this->assertSame($authenticationError, $utils->getLastAuthenticationError());
53-
$this->assertFalse($session->has(Security::AUTHENTICATION_ERROR));
53+
$this->assertFalse($session->has(SecurityRequestAttributes::AUTHENTICATION_ERROR));
5454
}
5555

5656
public function testLastAuthenticationErrorInSessionWithoutClearing()
@@ -60,21 +60,21 @@ public function testLastAuthenticationErrorInSessionWithoutClearing()
6060
$request = Request::create('/');
6161

6262
$session = new Session(new MockArraySessionStorage());
63-
$session->set(Security::AUTHENTICATION_ERROR, $authenticationError);
63+
$session->set(SecurityRequestAttributes::AUTHENTICATION_ERROR, $authenticationError);
6464
$request->setSession($session);
6565

6666
$requestStack = new RequestStack();
6767
$requestStack->push($request);
6868

6969
$utils = new AuthenticationUtils($requestStack);
7070
$this->assertSame($authenticationError, $utils->getLastAuthenticationError(false));
71-
$this->assertTrue($session->has(Security::AUTHENTICATION_ERROR));
71+
$this->assertTrue($session->has(SecurityRequestAttributes::AUTHENTICATION_ERROR));
7272
}
7373

7474
public function testLastUserNameIsDefinedButNull()
7575
{
7676
$request = Request::create('/');
77-
$request->attributes->set(Security::LAST_USERNAME, null);
77+
$request->attributes->set(SecurityRequestAttributes::LAST_USERNAME, null);
7878

7979
$requestStack = new RequestStack();
8080
$requestStack->push($request);
@@ -86,7 +86,7 @@ public function testLastUserNameIsDefinedButNull()
8686
public function testLastUserNameIsDefined()
8787
{
8888
$request = Request::create('/');
89-
$request->attributes->set(Security::LAST_USERNAME, 'user');
89+
$request->attributes->set(SecurityRequestAttributes::LAST_USERNAME, 'user');
9090

9191
$requestStack = new RequestStack();
9292
$requestStack->push($request);
@@ -100,7 +100,7 @@ public function testLastUserNameIsDefinedInSessionButNull()
100100
$request = Request::create('/');
101101

102102
$session = new Session(new MockArraySessionStorage());
103-
$session->set(Security::LAST_USERNAME, null);
103+
$session->set(SecurityRequestAttributes::LAST_USERNAME, null);
104104
$request->setSession($session);
105105

106106
$requestStack = new RequestStack();
@@ -115,7 +115,7 @@ public function testLastUserNameIsDefinedInSession()
115115
$request = Request::create('/');
116116

117117
$session = new Session(new MockArraySessionStorage());
118-
$session->set(Security::LAST_USERNAME, 'user');
118+
$session->set(SecurityRequestAttributes::LAST_USERNAME, 'user');
119119
$request->setSession($session);
120120

121121
$requestStack = new RequestStack();

0 commit comments

Comments
 (0)