Exemple #1
0
 public function testCheckoutAllSubmitAfter()
 {
     $inventoryProcessed = false;
     $websiteId = 0;
     $itemsToRegister = [];
     $itemsToReindex = [];
     $quote = $this->getMock('\\Magento\\Quote\\Model\\Quote', ['getInventoryProcessed', 'setInventoryProcessed', 'getAllItems', 'getStore', '__wakeup'], [], '', false);
     $quote->expects($this->atLeastOnce())->method('getInventoryProcessed', 'setInventoryProcessed', 'getStore')->will($this->returnValue($inventoryProcessed));
     $store = $this->getMock('Magento\\Store\\Model\\Store', ['getWebsiteId', '__wakeup'], [], '', false);
     $store->expects($this->once())->method('getWebsiteId')->will($this->returnValue($websiteId));
     $quote->expects($this->once())->method('getStore')->will($this->returnValue($store));
     $quote->expects($this->any())->method('getAllItems')->will($this->returnValue($itemsToRegister));
     $this->stockManagement->expects($this->once())->method('registerProductsSale')->will($this->returnValue($itemsToReindex));
     $this->event->expects($this->atLeastOnce())->method('getQuote')->will($this->returnValue($quote));
     $this->eventObserver->expects($this->atLeastOnce())->method('getEvent')->will($this->returnValue($this->event));
     $this->assertEquals($this->observer, $this->observer->checkoutAllSubmitAfter($this->eventObserver));
 }