public function beginAuthentication_authenticationStarted_sessionFlagSet()
{
$token = $this->getToken();
$context = $this->getAuthenticationContext($token);
//Stub the provider
$this->provider->expects($this->any())->method('beginAuthentication')->willReturn(true);
//Mock the SessionFlagManager
$this->flagManager->expects($this->once())->method('setBegin')->with('test', $token);
$this->registry->beginAuthentication($context);
}