public function testCheckAuthenticationFailed()
{
$user = $this->getMock('eZ\\Publish\\Core\\MVC\\Symfony\\Security\\User');
$userName = 'my_username';
$password = 'foo';
$token = new UsernamePasswordToken($userName, $password, 'bar');
$userService = $this->getMock('eZ\\Publish\\API\\Repository\\UserService');
$userService->expects($this->once())->method('loadUserByCredentials')->with($userName, $password)->will($this->throwException(new NotFoundException('what', 'identifier')));
$this->repository->expects($this->once())->method('getUserService')->will($this->returnValue($userService));
$method = new \ReflectionMethod($this->authProvider, 'checkAuthentication');
$method->setAccessible(true);
$method->invoke($this->authProvider, $user, $token);
}