Ejemplo n.º 1
0
 /**
  * @Given /^(this customer) verified their email$/
  */
 public function theCustomerVerifiedTheirEmail(CustomerInterface $customer)
 {
     $customer->getUser()->setVerifiedAt(new \DateTime());
     $this->customerManager->flush();
 }
Ejemplo n.º 2
0
 /**
  * @Then the customer :customer should have an account created
  * @Then /^(this customer) should have an account created$/
  */
 public function theyShouldHaveAnAccountCreated(CustomerInterface $customer)
 {
     Assert::notNull($customer->getUser()->getPassword(), 'Customer should have an account, but they do not.');
 }
Ejemplo n.º 3
0
 /**
  * @When I verify my account using link sent to :customer
  */
 public function iVerifyMyAccount(CustomerInterface $customer)
 {
     $user = $customer->getUser();
     Assert::notNull($user, 'No account for given customer');
     $this->iUseItToVerify($user);
 }
 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);
 }