function it_does_not_update_password_if_customer_does_not_have_user(PasswordUpdaterInterface $passwordUpdater, GenericEvent $event, CustomerInterface $customer) { $event->getSubject()->willReturn($customer); $customer->getUser()->willReturn(null); $passwordUpdater->updatePassword(null)->shouldNotBeCalled(); $this->customerUpdateEvent($event); }
/** * @param UserInterface $user */ public function updateUserPassword(UserInterface $user) { if (null !== $user->getPlainPassword()) { $this->passwordUpdater->updatePassword($user); } }
function it_updates_password_on_pre_update_doctrine_event_for_user_interface_implementation_only(PasswordUpdaterInterface $passwordUpdater, LifecycleEventArgs $event) { $event->getEntity()->willReturn('user'); $passwordUpdater->updatePassword(Argument::any())->shouldNotBeCalled(); $this->preUpdate($event); }