21
21
use Symfony \Component \Security \Core \Authentication \Token \Storage \TokenStorageInterface ;
22
22
use Symfony \Component \Security \Core \Authentication \Token \UsernamePasswordToken ;
23
23
use Symfony \Component \Security \Core \Authorization \AccessDecisionManagerInterface ;
24
+ use Symfony \Component \Security \Core \Authorization \Voter \AuthenticatedVoter ;
24
25
use Symfony \Component \Security \Core \Exception \AccessDeniedException ;
25
26
use Symfony \Component \Security \Core \User \User ;
26
27
use Symfony \Component \Security \Http \AccessMapInterface ;
@@ -272,13 +273,13 @@ public function testHandleWhenPublicAccessIsAllowedAndExceptionOnTokenIsFalse()
272
273
$ accessMap ->expects ($ this ->any ())
273
274
->method ('getPatterns ' )
274
275
->with ($ this ->equalTo ($ request ))
275
- ->willReturn ([[AccessListener ::PUBLIC_ACCESS ], null ])
276
+ ->willReturn ([[AuthenticatedVoter ::PUBLIC_ACCESS ], null ])
276
277
;
277
278
278
279
$ accessDecisionManager = $ this ->createMock (AccessDecisionManagerInterface::class);
279
280
$ accessDecisionManager ->expects ($ this ->once ())
280
281
->method ('decide ' )
281
- ->with ($ this ->isInstanceOf (NullToken::class), [AccessListener ::PUBLIC_ACCESS ])
282
+ ->with ($ this ->isInstanceOf (NullToken::class), [AuthenticatedVoter ::PUBLIC_ACCESS ])
282
283
->willReturn (true );
283
284
284
285
$ listener = new AccessListener (
@@ -303,13 +304,13 @@ public function testHandleWhenPublicAccessWhileAuthenticated()
303
304
$ accessMap ->expects ($ this ->any ())
304
305
->method ('getPatterns ' )
305
306
->with ($ this ->equalTo ($ request ))
306
- ->willReturn ([[AccessListener ::PUBLIC_ACCESS ], null ])
307
+ ->willReturn ([[AuthenticatedVoter ::PUBLIC_ACCESS ], null ])
307
308
;
308
309
309
310
$ accessDecisionManager = $ this ->createMock (AccessDecisionManagerInterface::class);
310
311
$ accessDecisionManager ->expects ($ this ->once ())
311
312
->method ('decide ' )
312
- ->with ($ this ->equalTo ($ token ), [AccessListener ::PUBLIC_ACCESS ])
313
+ ->with ($ this ->equalTo ($ token ), [AuthenticatedVoter ::PUBLIC_ACCESS ])
313
314
->willReturn (true );
314
315
315
316
$ listener = new AccessListener (
0 commit comments