function it_sets_canonical_email_when_initializing_customer($canonicalizer, CustomerInterface $customer) { $customer->getEmail()->willReturn('*****@*****.**'); $canonicalizer->canonicalize('*****@*****.**')->willReturn('*****@*****.**'); $customer->setEmailCanonical('*****@*****.**')->shouldBeCalled(); $this->initialize($customer); }
/** * {@inheritdoc} */ public function getEmail() { return $this->customer->getEmail(); }
function it_does_nothing_on_customer_update_when_no_user_associated(OnFlushEventArgs $onFlushEventArgs, EntityManager $entityManager, UnitOfWork $unitOfWork, CustomerInterface $customer) { $onFlushEventArgs->getEntityManager()->willReturn($entityManager); $entityManager->getUnitOfWork()->willReturn($unitOfWork); $unitOfWork->getScheduledEntityInsertions()->willReturn([]); $unitOfWork->getScheduledEntityUpdates()->willReturn([$customer]); $customer->getUser()->willReturn(null); $customer->getEmail()->willReturn('*****@*****.**'); $unitOfWork->recomputeSingleEntityChangeSet(Argument::cetera())->shouldNotBeCalled(); $this->onFlush($onFlushEventArgs); }
/** * @Then the customer :customer should appear in the store * @Then the customer :customer should still have this email */ public function theCustomerShould(CustomerInterface $customer) { $this->indexPage->open(); Assert::true($this->indexPage->isSingleResourceOnPage(['Email' => $customer->getEmail()]), sprintf('Customer with email %s should exist but it does not.', $customer->getEmail())); }