function it_sets_canonical_email_when_initializing_customer($canonicalizer, CustomerInterface $customer) { $customer->getEmail()->willReturn('*****@*****.**'); $canonicalizer->canonicalize('*****@*****.**')->willReturn('*****@*****.**'); $customer->setEmailCanonical('*****@*****.**')->shouldBeCalled(); $this->initialize($customer); }
/** * @Then I should see a single order from customer :customer */ public function iShouldSeeASingleOrderFromCustomer(CustomerInterface $customer) { Assert::true($this->indexPage->isSingleResourceOnPage(['customer' => $customer->getEmail()]), sprintf('Cannot find order for customer "%s" in the list.', $customer->getEmail())); }
/** * {@inheritdoc} */ public function getEmail() { return $this->customer->getEmail(); }
/** * @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())); }
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); }