protected function getCustomer() { $this->customerBuilderMock->expects($this->once())->method('setDob')->with($this->orderData['customerDob'])->will($this->returnSelf()); $this->customerBuilderMock->expects($this->once())->method('setEmail')->with($this->orderData['customerEmail'])->will($this->returnSelf()); $this->customerBuilderMock->expects($this->once())->method('setFirstname')->with($this->orderData['customerFirstName'])->will($this->returnSelf()); $this->customerBuilderMock->expects($this->once())->method('setGender')->with($this->orderData['customerGender'])->will($this->returnSelf()); $this->customerBuilderMock->expects($this->once())->method('setGroupId')->with($this->orderData['customerGroupId'])->will($this->returnSelf()); $this->customerBuilderMock->expects($this->once())->method('setId')->with($this->orderData['customerId'])->will($this->returnSelf()); $this->customerBuilderMock->expects($this->once())->method('setIsGuest')->with($this->orderData['customerIsGuest'])->will($this->returnSelf()); $this->customerBuilderMock->expects($this->once())->method('setLastname')->with($this->orderData['customerLastName'])->will($this->returnSelf()); $this->customerBuilderMock->expects($this->once())->method('setMiddlename')->with($this->orderData['customerMiddleName'])->will($this->returnSelf()); $this->customerBuilderMock->expects($this->once())->method('setNote')->with($this->orderData['customerNote'])->will($this->returnSelf()); $this->customerBuilderMock->expects($this->once())->method('setNoteNotify')->with($this->orderData['customerNotify'])->will($this->returnSelf()); $this->customerBuilderMock->expects($this->once())->method('setPrefix')->with($this->orderData['customerPrefix'])->will($this->returnSelf()); $this->customerBuilderMock->expects($this->once())->method('setSuffix')->with($this->orderData['customerSuffix'])->will($this->returnSelf()); $this->customerBuilderMock->expects($this->once())->method('setTaxvat')->with($this->orderData['customerTaxvat'])->will($this->returnSelf()); $customer = $this->getMock('Magento\\Sales\\Model\\Order\\Customer', [], [], '', false); $this->customerBuilderMock->expects($this->once())->method('create')->will($this->returnValue($customer)); return $customer; }
/** * Get Order Customer * * @param OrderData $dataObject * @return Order\Customer */ protected function getCustomer(OrderData $dataObject) { $this->customerBuilder->setDob($dataObject->getCustomerDob())->setEmail($dataObject->getCustomerEmail())->setFirstName($dataObject->getCustomerFirstname())->setGender($dataObject->getCustomerGender())->setGroupId($dataObject->getCustomerGroupId())->setId($dataObject->getCustomerId())->setIsGuest($dataObject->getCustomerIsGuest())->setLastName($dataObject->getCustomerLastname())->setMiddleName($dataObject->getCustomerMiddlename())->setNote($dataObject->getCustomerNote())->setNoteNotify($dataObject->getCustomerNoteNotify())->setPrefix($dataObject->getCustomerPrefix())->setSuffix($dataObject->getCustomerSuffix())->setTaxvat($dataObject->getCustomerTaxvat()); return $this->customerBuilder->create(); }
/** * Run test create method */ public function testCreate() { $customerMock = $this->getMock('Magento\\Sales\\Model\\Order\\Customer', [], [], '', false); $this->objectManagerMock->expects($this->once())->method('create')->will($this->returnValue($customerMock)); $this->assertEquals($customerMock, $this->builder->create()); }