Exemplo n.º 1
0
 /**
  * @magentoAppIsolation enabled
  */
 public function testSaveOrder()
 {
     $this->_model->saveBilling($this->_getCustomerData(), null);
     $this->_prepareQuote($this->_getQuote());
     $this->_model->saveOrder();
     /** @var $order \Magento\Sales\Model\Order */
     $order = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Sales\\Model\\Order');
     $order->loadByIncrementId($this->_model->getLastOrderId());
     $this->assertNotEmpty($this->_model->getQuote()->getShippingAddress()->getCustomerAddressId(), 'Quote shipping CustomerAddressId should not be empty');
     $this->assertNotEmpty($this->_model->getQuote()->getBillingAddress()->getCustomerAddressId(), 'Quote billing CustomerAddressId should not be empty');
     $this->assertNotEmpty($order->getShippingAddress()->getCustomerAddressId(), 'Order shipping CustomerAddressId should not be empty');
     $this->assertNotEmpty($order->getBillingAddress()->getCustomerAddressId(), 'Order billing CustomerAddressId should not be empty');
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function saveOrder()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'saveOrder');
     if (!$pluginInfo) {
         return parent::saveOrder();
     } else {
         return $this->___callPlugins('saveOrder', func_get_args(), $pluginInfo);
     }
 }