public function dispatchSetsInterceptedRequestIfSecurityContextContainsAuthenticationTokensWithEntryPoints()
{
$this->mockActionRequest->expects($this->any())->method('isDispatched')->will($this->returnValue(true));
$mockEntryPoint = $this->getMockBuilder(EntryPointInterface::class)->getMock();
$mockAuthenticationToken = $this->getMockBuilder(TokenInterface::class)->getMock();
$mockAuthenticationToken->expects($this->any())->method('getAuthenticationEntryPoint')->will($this->returnValue($mockEntryPoint));
$this->mockSecurityContext->expects($this->atLeastOnce())->method('getAuthenticationTokens')->will($this->returnValue([$mockAuthenticationToken]));
$this->mockSecurityContext->expects($this->atLeastOnce())->method('setInterceptedRequest')->with($this->mockMainRequest);
$this->mockFirewall->expects($this->once())->method('blockIllegalRequests')->will($this->throwException(new AuthenticationRequiredException()));
try {
$this->dispatcher->dispatch($this->mockActionRequest, $this->mockHttpResponse);
} catch (AuthenticationRequiredException $exception) {
}
}