Exemplo n.º 1
0
 /**
  * Remove item
  *
  * @param Address $address
  * @param  AddressItem|Item $item
  * @return $this
  */
 protected function _removeItem($address, $item)
 {
     if ($item instanceof Item) {
         $address->removeItem($item->getId());
         if ($address->getQuote()) {
             $address->getQuote()->removeItem($item->getId());
         }
     } elseif ($item instanceof AddressItem) {
         $address->removeItem($item->getId());
         if ($address->getQuote()) {
             $address->getQuote()->removeItem($item->getQuoteItemId());
         }
     }
     return $this;
 }
Exemplo n.º 2
0
 /**
  * Verify fields in quote item
  *
  * @param \Magento\Sales\Model\Quote\Address\Item $item
  * @param array $expectedItemData
  * @return $this
  */
 protected function verifyItem($item, $expectedItemData)
 {
     foreach ($expectedItemData as $key => $value) {
         $this->assertEquals($value, $item->getData($key), 'item ' . $key . ' is incorrect');
     }
     return $this;
 }