本文整理汇总了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);
}