/** * @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); }
/** * @param SecurityUserInterface $user * * @return SecurityUserInterface * @throws UnsupportedUserException */ public function refreshUser(SecurityUserInterface $user) { if ($this->stateless) { throw new UnsupportedUserException(); } return parent::refreshUser($user); }
/** * @expectedException Symfony\Component\Security\Core\Exception\UnsupportedUserException */ public function testRefreshInvalidUser() { $user = $this->getMock('Symfony\\Component\\Security\\Core\\User\\UserInterface'); $this->userProvider->refreshUser($user); }