コード例 #1
0
 /**
  * When handling the after set qty event,
  * quote item quantities should be checked by checking
  * quote inventory via the quantity service model.
  */
 public function testHandleAfterSetItemQty()
 {
     $quoteItem = Mage::getModel('sales/quote_item');
     $this->_event->setItem($quoteItem);
     // Side-effect test: just need to make sure quote inventory
     // is checked via the quantity service model.
     $this->_quantityService->expects($this->once())->method('checkQuoteItemInventory')->with($this->identicalTo($quoteItem))->will($this->returnSelf());
     $this->_inventoryObserver->handleAfterSetItemQty($this->_eventObserver);
 }
コード例 #2
0
 /**
  * When handling the before collect totals event,
  * quote item quantities should be checked by checking
  * quote inventory via the quantity service model.
  */
 public function testHandleBeforeCollectTotals()
 {
     $quote = Mage::getModel('sales/quote');
     $this->_event->setQuote($quote);
     // Side-effect test: just need to make sure quote inventory
     // is checked via the quantity service model.
     $this->_quantityService->expects($this->once())->method('checkQuoteInventory')->with($this->identicalTo($quote))->will($this->returnSelf());
     $this->_inventoryObserver->handleBeforeCollectTotals($this->_eventObserver);
 }