Exemple #1
0
 public function testGetCustomerTaxClassId()
 {
     $groupId = 1;
     $taxClassId = 1;
     $customerGroupMock = $this->getMockBuilder('Magento\\Customer\\Service\\V1\\Data\\CustomerGroup')->disableOriginalConstructor()->getMock();
     $customerGroupMock->expects($this->once())->method('getTaxClassId')->will($this->returnValue($taxClassId));
     $this->customerGroupServiceMock->expects($this->once())->method('getGroup')->with($groupId)->will($this->returnValue($customerGroupMock));
     $this->quote->setData('customer_group_id', $groupId);
     $result = $this->quote->getCustomerTaxClassId();
     $this->assertEquals($taxClassId, $result);
 }
Exemple #2
0
 /**
  * Fetch quote customer data
  *
  * @param Quote $quote
  * @return array
  */
 public function map(Quote $quote)
 {
     return [Customer::ID => $quote->getCustomerId(), Customer::EMAIL => $quote->getCustomerEmail(), Customer::GROUP_ID => $quote->getCustomerGroupId(), Customer::TAX_CLASS_ID => $quote->getCustomerTaxClassId(), Customer::PREFIX => $quote->getCustomerPrefix(), Customer::FIRST_NAME => $quote->getCustomerFirstname(), Customer::MIDDLE_NAME => $quote->getCustomerMiddlename(), Customer::LAST_NAME => $quote->getCustomerLastname(), Customer::SUFFIX => $quote->getCustomerSuffix(), Customer::DOB => $quote->getCustomerDob(), Customer::NOTE => $quote->getCustomerNote(), Customer::NOTE_NOTIFY => $quote->getCustomerNoteNotify(), Customer::IS_GUEST => $quote->getCustomerIsGuest(), Customer::GENDER => $quote->getCustomerGender(), Customer::TAXVAT => $quote->getCustomerTaxvat()];
 }