示例#1
0
 /**
  * @return void
  */
 public function setUp()
 {
     $customer = new SpyCustomer();
     $customer->setFirstName('firstname');
     $customer->setLastName('lastname');
     $customer->setEmail('*****@*****.**');
     $customer->setCustomerReference('reference');
     $customer->save();
     $this->customer = $customer;
     $customerBusinessFactory = $this->getBusinessFactory();
     $customerFacade = new CustomerFacade();
     $customerFacade->setFactory($customerBusinessFactory);
     $controllerMock = $this->getMockBuilder(EditController::class)->setMethods(['getFactory', 'getFacade'])->getMock();
     $controllerMock->method('getFactory')->willReturn(new CustomerCommunicationFactory());
     $controllerMock->method('getFacade')->willReturn($customerFacade);
     $this->controller = $controllerMock;
 }
示例#2
0
 /**
  * @expectedException \Spryker\Zed\Customer\Business\Exception\AddressNotFoundException
  *
  * @return void
  */
 public function testDeleteCustomerWithDefaultAddresses()
 {
     $customerTransfer = $this->createCustomerWithAddress();
     $addresses = $customerTransfer->getAddresses()->getAddresses();
     $addressTransfer = $addresses[0];
     $this->customerFacade->setDefaultBillingAddress($addressTransfer);
     $this->customerFacade->setDefaultShippingAddress($addressTransfer);
     $isSuccess = $this->customerFacade->deleteCustomer($customerTransfer);
     $this->assertTrue($isSuccess);
     $this->customerFacade->getAddress($addressTransfer);
 }
示例#3
0
 /**
  * @param \Spryker\Shared\Transfer\TransferInterface|null $transfer
  * @param bool $hasEmail
  *
  * @return \Spryker\Zed\Customer\Business\CustomerFacade
  */
 private function getFacade(TransferInterface $transfer = null, $hasEmail = true)
 {
     $customerFacade = new CustomerFacade();
     $customerFacade->setFactory($this->getFactory($transfer, $hasEmail));
     return $customerFacade;
 }