/** * {@inheritdoc} */ public function getEmailCanonical() { return $this->customer->getEmailCanonical(); }
function it_does_not_update_usernames_when_customer_emails_are_the_same(OnFlushEventArgs $onFlushEventArgs, EntityManager $entityManager, UnitOfWork $unitOfWork, CustomerInterface $customer, UserInterface $user, ClassMetadata $userMetadata) { $onFlushEventArgs->getEntityManager()->willReturn($entityManager); $entityManager->getUnitOfWork()->willReturn($unitOfWork); $unitOfWork->getScheduledEntityInsertions()->willReturn([]); $unitOfWork->getScheduledEntityUpdates()->willReturn([$customer]); $user->getUsername()->willReturn('*****@*****.**'); $user->getUsernameCanonical()->willReturn('*****@*****.**'); $customer->getUser()->willReturn($user); $customer->getEmail()->willReturn('*****@*****.**'); $customer->getEmailCanonical()->willReturn('*****@*****.**'); $user->setUsername(Argument::any())->shouldNotBeCalled(); $user->setUsernameCanonical(Argument::any())->shouldNotBeCalled(); $unitOfWork->recomputeSingleEntityChangeSet(Argument::cetera())->shouldNotBeCalled(); $this->onFlush($onFlushEventArgs); }