File tree Expand file tree Collapse file tree
tests/ExpressionLanguage/ExpressionFunction/Security Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,9 +104,7 @@ public function hasRole(string $role): bool
104104
105105 public function isAnonymous (): bool
106106 {
107- // IS_AUTHENTICATED_ANONYMOUSLY was removed from AuthenticatedVoter in Symfony 6.x.
108- // PUBLIC_ACCESS (added in Symfony 5.4) is the correct replacement and always grants access.
109- return $ this ->isGranted (Kernel::VERSION_ID >= 60000 ? 'PUBLIC_ACCESS ' : 'IS_AUTHENTICATED_ANONYMOUSLY ' );
107+ return $ this ->isGranted ('PUBLIC_ACCESS ' );
110108 }
111109
112110 public function isAuthenticated (): bool
Original file line number Diff line number Diff line change @@ -17,10 +17,7 @@ protected function getFunctions()
1717
1818 public function testEvaluator (): void
1919 {
20- $ security = $ this ->getSecurityIsGrantedWithExpectation (
21- 'IS_AUTHENTICATED_ANONYMOUSLY ' ,
22- $ this ->any ()
23- );
20+ $ security = $ this ->getSecurityIsGrantedWithExpectation ('PUBLIC_ACCESS ' , $ this ->any ());
2421 $ services = $ this ->createGraphQLServices (['security ' => $ security ]);
2522
2623 $ isAnonymous = $ this ->expressionLanguage ->evaluate ('isAnonymous() ' , [TypeGenerator::GRAPHQL_SERVICES => $ services ]);
@@ -29,6 +26,6 @@ public function testEvaluator(): void
2926
3027 public function testIsAnonymous (): void
3128 {
32- $ this ->assertExpressionCompile ('isAnonymous() ' , 'IS_AUTHENTICATED_ANONYMOUSLY ' );
29+ $ this ->assertExpressionCompile ('isAnonymous() ' , 'PUBLIC_ACCESS ' );
3330 }
3431}
You can’t perform that action at this time.
0 commit comments