本文整理匯總了PHP中DataHandler::processLots方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataHandler::processLots方法的具體用法?PHP DataHandler::processLots怎麽用?PHP DataHandler::processLots使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DataHandler
的用法示例。
在下文中一共展示了DataHandler::processLots方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: test_processLots
public function test_processLots()
{
/** === Test Data === */
$LOT1 = new \Praxigento\Odoo\Data\Odoo\Inventory\Product\Warehouse\Lot();
$LOTS = [$LOT1];
$STOCK_ITEM_ID = 21;
$STOCK_ITEM = $this->_mock(\Magento\CatalogInventory\Api\Data\StockItemInterface::class);
$QTY = 5400;
/** === Setup Mocks === */
// $stockItemId = $stockItem->getItemId();
$STOCK_ITEM->shouldReceive('getItemId')->once()->andReturn($STOCK_ITEM_ID);
// $qtyTotal += $this->_subLot->processLot($stockItemId, $lot);
$this->mSubLot->shouldReceive('processLot')->once()->andReturn($QTY);
// $stockItem->setQty($qtyTotal);
$STOCK_ITEM->shouldReceive('setQty');
// $stockItem->setIsInStock($isInStock);
$STOCK_ITEM->shouldReceive('setIsInStock');
// $this->_mageRepoStockItem->save($stockItem);
$this->mMageRepoStockItem->shouldReceive('save')->once();
// $this->_subLot->cleanupLots($stockItemId, $lots);
$this->mSubLot->shouldReceive('cleanupLots')->once();
/** === Call and asserts === */
$this->obj->processLots($LOTS, $STOCK_ITEM);
}