/** * @expectedException \Symfony\Component\Security\Core\Exception\UnsupportedUserException */ public function testRefreshInvalidUserClass() { $user = $this->createMock('FOS\\UserBundle\\Model\\User'); $providedUser = $this->createMock('FOS\\UserBundle\\Tests\\TestUser'); $this->userManager->expects($this->atLeastOnce())->method('getClass')->will($this->returnValue(get_class($user))); $this->userProvider->refreshUser($providedUser); }
/** * {@inheritdoc} */ public function loadUserByUsername($username) { /** @var User $user */ $user = $this->userProvider->loadUserByUsername($username); if (!$user) { throw new UsernameNotFoundException(sprintf('El usuario "%s" no existe.', $username)); } return $user; }
public function loadUserByUsername($username) { $parts = $this->emailParser->parse($username); $this->verifyDomain($parts['domain']); $user = parent::loadUserByUsername($username); return $user; }
/** * @param SecurityUserInterface $user * * @return SecurityUserInterface * @throws UnsupportedUserException */ public function refreshUser(SecurityUserInterface $user) { if ($this->stateless) { throw new UnsupportedUserException(); } return parent::refreshUser($user); }
/** * @DI\InjectParams({ * "userManager" = @DI\Inject("fos_user.user_manager") * }) * * {@inheritDoc} */ public function __construct(UserManagerInterface $userManager) { parent::__construct($userManager); }
/** * * Class constructor * @param UserManagerInterface * @param ContainerInterface * */ public function __construct(UserProviderInterface $userProvider, ContainerInterface $container) { parent::__construct($userProvider); $this->container = $container; }
/** * @expectedException Symfony\Component\Security\Core\Exception\UnsupportedUserException */ public function testRefreshInvalidUser() { $user = $this->getMock('Symfony\\Component\\Security\\Core\\User\\UserInterface'); $this->userProvider->refreshUser($user); }
/** * * @param unknown $class */ public function supportsClass($class) { return $this->userProvider->supportsClass($class); }
public function __construct(UserManagerInterface $userManager, EntityManager $em, TokenGenerator $tokenGenerator) { parent::__construct($userManager); $this->em = $em; $this->tokenGenerator = $tokenGenerator; }