$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() { if ((new \
ReflectionMethod(AuthenticationEntryPointInterface::
class, 'start'
))->
hasReturnType()) { $this->
markTestSkipped('Native return type found'
);
} $event =
$this->
createEvent(new AuthenticationException());
$entryPoint =
$this->
createMock(AuthenticationEntryPointInterface::
class);
$entryPoint->
expects($this->
once())->
method('start'
)->
willReturn('NOT A RESPONSE'
);
$listener =
$this->
createExceptionListener(null, null, null,
$entryPoint);
$listener->
onKernelException($event);
// the exception has been replaced by our LogicException