本文整理汇总了PHP中Sylius\Component\User\Model\UserInterface::getPassword方法的典型用法代码示例。如果您正苦于以下问题:PHP UserInterface::getPassword方法的具体用法?PHP UserInterface::getPassword怎么用?PHP UserInterface::getPassword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sylius\Component\User\Model\UserInterface
的用法示例。
在下文中一共展示了UserInterface::getPassword方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function it_does_not_log_user_in_if_user_was_not_found($userRepository, $session, UserInterface $user, Session $minkSession)
{
$userRoles = ['ROLE_USER'];
$userRepository->findOneBy(array('username' => 'sylius@example.com'))->willReturn(null);
$user->getRoles()->willReturn($userRoles);
$user->getPassword()->willReturn('xyz');
$user->serialize()->willReturn('serialized_user');
$session->set('_security_user', Argument::any())->shouldNotBeCalled();
$session->save()->shouldNotBeCalled();
$session->getName()->willReturn('MOCKEDSID');
$session->getId()->willReturn('xyzc123');
$minkSession->setCookie('MOCKEDSID', 'xyzc123')->shouldNotBeCalled();
$this->shouldThrow(new \InvalidArgumentException(sprintf('There is no user with email sylius@example.com')))->during('logIn', array('sylius@example.com', 'default', $minkSession));
}
示例2: logIn
/**
* {@inheritdoc}
*/
public function logIn(UserInterface $user)
{
$token = new UsernamePasswordToken($user, $user->getPassword(), 'randomstringbutnotnull', $user->getRoles());
$this->setToken($token);
}
示例3: logUserIn
/**
* @param UserInterface $user
*/
private function logUserIn(UserInterface $user)
{
$token = new UsernamePasswordToken($user, $user->getPassword(), 'randomstringbutnotnull', $user->getRoles());
$serializedToken = serialize($token);
$this->setSerializedToken($serializedToken);
$this->cookieSetter->setCookie($this->session->getName(), $this->session->getId());
}