Exemple #1
0
 public function testValidateMiniumumAmountNegative()
 {
     $storeId = 1;
     $scopeConfigValues = [['sales/minimum_order/active', ScopeInterface::SCOPE_STORE, $storeId, true], ['sales/minimum_order/amount', ScopeInterface::SCOPE_STORE, $storeId, 20], ['sales/minimum_order/tax_including', ScopeInterface::SCOPE_STORE, $storeId, true]];
     $this->quote->expects($this->once())->method('getStoreId')->willReturn($storeId);
     $this->quote->expects($this->once())->method('getIsVirtual')->willReturn(false);
     $this->address->setAddressType(Address::TYPE_SHIPPING);
     $this->scopeConfig->expects($this->once())->method('isSetFlag')->willReturnMap($scopeConfigValues);
     $this->assertTrue($this->address->validateMinimumAmount());
 }
Exemple #2
0
 /**
  * Set shipping address
  *
  * @param Address $address
  * @return $this
  */
 public function setShippingAddress(Address $address)
 {
     if ($this->getIsMultiShipping()) {
         $this->addAddress($address->setAddressType(Address::TYPE_SHIPPING));
     } else {
         $old = $this->getShippingAddress();
         if (!empty($old)) {
             $old->addData($address->getData());
         } else {
             $this->addAddress($address->setAddressType(Address::TYPE_SHIPPING));
         }
     }
     return $this;
 }