當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserInterface::getPassword方法代碼示例

本文整理匯總了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));
 }
開發者ID:Spomky,項目名稱:Sylius,代碼行數:14,代碼來源:SecurityServiceSpec.php

示例2: logIn

 /**
  * {@inheritdoc}
  */
 public function logIn(UserInterface $user)
 {
     $token = new UsernamePasswordToken($user, $user->getPassword(), 'randomstringbutnotnull', $user->getRoles());
     $this->setToken($token);
 }
開發者ID:ReissClothing,項目名稱:Sylius,代碼行數:8,代碼來源:SecurityService.php

示例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());
 }
開發者ID:TeamNovatek,項目名稱:Sylius,代碼行數:10,代碼來源:SecurityService.php


注:本文中的Sylius\Component\User\Model\UserInterface::getPassword方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。