Skip to content

Commit 98802e5

Browse files
committed
Use PUBLIC_ACCESS from AuthenticatedVoter
1 parent c4ff074 commit 98802e5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
2222
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
2323
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
24+
use Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter;
2425
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
2526
use Symfony\Component\Security\Core\User\User;
2627
use Symfony\Component\Security\Http\AccessMapInterface;
@@ -272,13 +273,13 @@ public function testHandleWhenPublicAccessIsAllowedAndExceptionOnTokenIsFalse()
272273
$accessMap->expects($this->any())
273274
->method('getPatterns')
274275
->with($this->equalTo($request))
275-
->willReturn([[AccessListener::PUBLIC_ACCESS], null])
276+
->willReturn([[AuthenticatedVoter::PUBLIC_ACCESS], null])
276277
;
277278

278279
$accessDecisionManager = $this->createMock(AccessDecisionManagerInterface::class);
279280
$accessDecisionManager->expects($this->once())
280281
->method('decide')
281-
->with($this->isInstanceOf(NullToken::class), [AccessListener::PUBLIC_ACCESS])
282+
->with($this->isInstanceOf(NullToken::class), [AuthenticatedVoter::PUBLIC_ACCESS])
282283
->willReturn(true);
283284

284285
$listener = new AccessListener(
@@ -303,13 +304,13 @@ public function testHandleWhenPublicAccessWhileAuthenticated()
303304
$accessMap->expects($this->any())
304305
->method('getPatterns')
305306
->with($this->equalTo($request))
306-
->willReturn([[AccessListener::PUBLIC_ACCESS], null])
307+
->willReturn([[AuthenticatedVoter::PUBLIC_ACCESS], null])
307308
;
308309

309310
$accessDecisionManager = $this->createMock(AccessDecisionManagerInterface::class);
310311
$accessDecisionManager->expects($this->once())
311312
->method('decide')
312-
->with($this->equalTo($token), [AccessListener::PUBLIC_ACCESS])
313+
->with($this->equalTo($token), [AuthenticatedVoter::PUBLIC_ACCESS])
313314
->willReturn(true);
314315

315316
$listener = new AccessListener(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy