当前位置: 首页>>代码示例>>PHP>>正文


PHP UserInterface::getSalt方法代码示例

本文整理汇总了PHP中Sylius\Component\User\Model\UserInterface::getSalt方法的典型用法代码示例。如果您正苦于以下问题:PHP UserInterface::getSalt方法的具体用法?PHP UserInterface::getSalt怎么用?PHP UserInterface::getSalt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sylius\Component\User\Model\UserInterface的用法示例。


在下文中一共展示了UserInterface::getSalt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 function it_encodes_password(EncoderFactoryInterface $encoderFactory, PasswordEncoderInterface $passwordEncoder, UserInterface $user)
 {
     $user->getPlainPassword()->willReturn('topSecretPlainPassword');
     $user->getSalt()->willReturn('typicalSalt');
     $encoderFactory->getEncoder($user)->willReturn($passwordEncoder);
     $passwordEncoder->encodePassword('topSecretPlainPassword', 'typicalSalt')->willReturn('topSecretEncodedPassword');
     $this->encode($user)->shouldReturn('topSecretEncodedPassword');
 }
开发者ID:nanyi,项目名称:Sylius,代码行数:8,代码来源:UserPasswordEncoderSpec.php

示例2: it_does_nothing_if_plain_password_is_empty

 public function it_does_nothing_if_plain_password_is_empty($encoderFactory, PasswordEncoderInterface $encoder, UserInterface $user)
 {
     $user->getPlainPassword()->willReturn('');
     $user->getSalt()->willReturn('typicalSalt');
     $encoderFactory->getEncoder($user)->shouldNotBeCalled();
     $encoder->encodePassword('', 'typicalSalt')->shouldNotBeCalled();
     $user->setPassword(Argument::any())->shouldNotBeCalled();
     $user->eraseCredentials()->shouldNotBeCalled();
     $this->updatePassword($user);
 }
开发者ID:Strontium-90,项目名称:Sylius,代码行数:10,代码来源:PasswordUpdaterSpec.php

示例3: encode

 /**
  * {@inheritdoc}
  *
  * @throws \LogicException when the algorithm is not supported
  */
 public function encode(UserInterface $user)
 {
     return $this->encodePassword($user->getPlainPassword(), $user->getSalt());
 }
开发者ID:kongqingfu,项目名称:Sylius,代码行数:9,代码来源:UserPbkdf2PasswordEncoder.php

示例4:

 function it_encodes_password(UserInterface $user)
 {
     $user->getPlainPassword()->willReturn('myPassword');
     $user->getSalt()->willReturn('typicalSalt');
     $this->encode($user)->shouldReturn('G1DuArwJiu+4Ctk9p2965gC3SXjGcom6gNhmV0OGUm79Kb9Anm5GWg==');
 }
开发者ID:nanyi,项目名称:Sylius,代码行数:6,代码来源:UserPbkdf2PasswordEncoderSpec.php


注:本文中的Sylius\Component\User\Model\UserInterface::getSalt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。