$this->
assertEquals('Forbidden',
$event->
getResponse()->
getContent());
$this->
assertEquals(403,
$event->
getResponse()->
getStatusCode());
$this->
assertSame($exception,
$event->
getThrowable());
} public static function getAuthenticationExceptionProvider() { return [ [$e =
new AuthenticationException(),
new HttpException(Response::HTTP_UNAUTHORIZED, '',
$e,
[], 0
)],
[new \
LogicException('random', 0,
$e =
new AuthenticationException()),
new HttpException(Response::HTTP_UNAUTHORIZED, '',
$e,
[], 0
)],
[new \
LogicException('random', 0,
$e =
new AuthenticationException('embed', 0,
new AuthenticationException())),
new HttpException(Response::HTTP_UNAUTHORIZED, 'embed',
$e,
[], 0
)],
[new \
LogicException('random', 0,
$e =
new AuthenticationException('embed', 0,
new AccessDeniedException())),
new HttpException(Response::HTTP_UNAUTHORIZED, 'embed',
$e,
[], 0
)],
[$e =
new AuthenticationException('random', 0,
new \
LogicException()),
new HttpException(Response::HTTP_UNAUTHORIZED, 'random',
$e,
[], 0
)],
];
} /**
* This test should be removed in Symfony 7.0 when adding native return types to AuthenticationEntryPointInterface::start().
*
* @group legacy
*/
public function testExceptionWhenEntryPointReturnsBadValue() {