本文整理匯總了PHP中Magento\Sales\Test\Fixture\OrderInjectable::getTotalQtyOrdered方法的典型用法代碼示例。如果您正苦於以下問題:PHP OrderInjectable::getTotalQtyOrdered方法的具體用法?PHP OrderInjectable::getTotalQtyOrdered怎麽用?PHP OrderInjectable::getTotalQtyOrdered使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Sales\Test\Fixture\OrderInjectable
的用法示例。
在下文中一共展示了OrderInjectable::getTotalQtyOrdered方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: processAssert
/**
* Assert that shipped items quantity in 'Total Quantity' is equal to data from fixture on My Account page
*
* @param OrderHistory $orderHistory
* @param OrderInjectable $order
* @param CustomerOrderView $customerOrderView
* @param ShipmentView $shipmentView
* @param array $ids
* @return void
*/
public function processAssert(OrderHistory $orderHistory, OrderInjectable $order, CustomerOrderView $customerOrderView, ShipmentView $shipmentView, array $ids)
{
$totalQty = $order->getTotalQtyOrdered();
$this->loginCustomerAndOpenOrderPage($order->getDataFieldConfig('customer_id')['source']->getCustomer());
$orderHistory->getOrderHistoryBlock()->openOrderById($order->getId());
$customerOrderView->getOrderViewBlock()->openLinkByName('Order Shipments');
foreach ($ids['shipmentIds'] as $key => $shipmentIds) {
\PHPUnit_Framework_Assert::assertEquals($totalQty[$key], $shipmentView->getShipmentBlock()->getItemShipmentBlock($shipmentIds)->getTotalQty());
}
}
示例2: processAssert
/**
* Assert shipment with corresponding shipment/order ID is present in 'Shipments' with correct total qty field
*
* @param ShipmentIndex $shipmentIndex
* @param OrderInjectable $order
* @param array $ids
* @return void
*/
public function processAssert(ShipmentIndex $shipmentIndex, OrderInjectable $order, array $ids)
{
$shipmentIndex->open();
$orderId = $order->getId();
$totalQty = $order->getTotalQtyOrdered();
foreach ($ids['shipmentIds'] as $key => $shipmentIds) {
$filter = ['id' => $shipmentIds, 'order_id' => $orderId, 'total_qty_from' => $totalQty[$key], 'total_qty_to' => $totalQty[$key]];
\PHPUnit_Framework_Assert::assertTrue($shipmentIndex->getShipmentsGrid()->isRowVisible($filter), 'Shipment is absent in shipment grid on shipment index page.');
}
}
示例3: processAssert
/**
* Assert that shipment is present in the Shipments tab with correct shipped items quantity
*
* @param SalesOrderView $salesOrderView
* @param OrderIndex $orderIndex
* @param OrderInjectable $order
* @param array $ids
* @return void
*/
public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderIndex, OrderInjectable $order, array $ids)
{
$orderIndex->open();
$orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]);
$salesOrderView->getOrderForm()->openTab('shipments');
$totalQty = $order->getTotalQtyOrdered();
$totalQty = is_array($totalQty) ? $totalQty : [$totalQty];
foreach ($ids['shipmentIds'] as $key => $shipmentId) {
$filter = ['id' => $shipmentId, 'qty_from' => $totalQty[$key], 'qty_to' => $totalQty[$key]];
\PHPUnit_Framework_Assert::assertTrue($salesOrderView->getOrderForm()->getTabElement('shipments')->getGridBlock()->isRowVisible($filter), 'Shipment is absent on shipments tab.');
}
}