File tree Expand file tree Collapse file tree 1 file changed +2
-31
lines changed
src/Symfony/Bundle/SecurityBundle/Tests/Security Expand file tree Collapse file tree 1 file changed +2
-31
lines changed Original file line number Diff line number Diff line change 8
8
use Symfony \Component \DependencyInjection \Container ;
9
9
use Symfony \Component \HttpFoundation \Request ;
10
10
use Symfony \Component \HttpFoundation \RequestStack ;
11
+ use Symfony \Component \Security \Core \User \InMemoryUser ;
11
12
use Symfony \Component \Security \Core \User \InMemoryUserProvider ;
12
13
use Symfony \Component \Security \Core \User \UserInterface ;
13
14
use Symfony \Component \Security \Http \Authenticator \HttpBasicAuthenticator ;
@@ -19,37 +20,7 @@ public function testThrowsLogicExceptionIfCurrentRequestIsNull()
19
20
$ container = new Container ();
20
21
$ firewallMap = new FirewallMap ($ container , []);
21
22
$ requestStack = new RequestStack ();
22
- $ user = new class () implements UserInterface {
23
- public function getUsername ()
24
- {
25
- return 'impersonated ' ;
26
- }
27
-
28
- public function getUserIdentifier ()
29
- {
30
- return 'impersonated ' ;
31
- }
32
-
33
- public function getPassword ()
34
- {
35
- return null ;
36
- }
37
-
38
- public function eraseCredentials ()
39
- {
40
- }
41
-
42
- public function getRoles ()
43
- {
44
- return ['ROLE_USER ' ];
45
- }
46
-
47
- public function getSalt ()
48
- {
49
- return null ;
50
- }
51
- };
52
-
23
+ $ user = new InMemoryUser ('username ' , 'password ' );
53
24
$ userProvider = new InMemoryUserProvider ();
54
25
$ authenticator = new HttpBasicAuthenticator ('name ' , $ userProvider );
55
26
$ request = new Request ();
You can’t perform that action at this time.
0 commit comments