本文整理汇总了PHP中magento\sales\test\page\adminhtml\OrderIndex::getSalesOrderGrid方法的典型用法代码示例。如果您正苦于以下问题:PHP OrderIndex::getSalesOrderGrid方法的具体用法?PHP OrderIndex::getSalesOrderGrid怎么用?PHP OrderIndex::getSalesOrderGrid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类magento\sales\test\page\adminhtml\OrderIndex
的用法示例。
在下文中一共展示了OrderIndex::getSalesOrderGrid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test
/**
* Mass orders update.
*
* @param string $steps
* @param int $ordersCount
* @param string $action
* @param string $resultStatuses
* @return array
*/
public function test($steps, $ordersCount, $action, $resultStatuses)
{
// Preconditions
$orders = $this->createOrders($ordersCount, $steps);
$items = $this->prepareFilter($orders);
// Steps
$this->orderIndex->open();
$this->orderIndex->getSalesOrderGrid()->massaction($items, $action);
return ['orders' => $orders, 'orderStatuses' => explode(',', $resultStatuses)];
}
示例2: test
/**
* Put created order on hold.
*
* @param OrderInjectable $order
* @return array
*/
public function test(OrderInjectable $order)
{
// Preconditions
$order->persist();
// Steps
$this->orderIndex->open();
$this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]);
$this->salesOrderView->getPageActions()->hold();
return ['customer' => $order->getDataFieldConfig('customer_id')['source']->getCustomer()];
}
示例3: run
/**
* Create shipping for order on backend.
*
* @return array
*/
public function run()
{
$this->orderIndex->open();
$this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $this->order->getId()]);
$this->salesOrderView->getPageActions()->ship();
if (!empty($this->data)) {
$this->orderShipmentNew->getFormBlock()->fillData($this->data, $this->order->getEntityId()['products']);
}
$this->orderShipmentNew->getFormBlock()->submit();
return ['shipmentIds' => $this->getShipmentIds()];
}
示例4: processAssert
/**
* Assert that order Id is present in search results
*
* @param Dashboard $dashboard
* @param GlobalSearch $search
* @param OrderIndex $orderIndex
* @return void
*/
public function processAssert(Dashboard $dashboard, GlobalSearch $search, OrderIndex $orderIndex)
{
$order = $search->getDataFieldConfig('query')['source']->getEntity();
$orderId = "Order #" . $order->getId();
$isVisibleInResult = $dashboard->getAdminPanelHeader()->isSearchResultVisible($orderId);
\PHPUnit_Framework_Assert::assertTrue($isVisibleInResult, 'Order Id ' . $order->getId() . ' is absent in search results');
$dashboard->getAdminPanelHeader()->navigateToGrid("Orders");
$isOrderGridVisible = $orderIndex->getSalesOrderGrid()->isVisible();
\PHPUnit_Framework_Assert::assertTrue($isOrderGridVisible, 'Order grid is not visible');
\PHPUnit_Framework_Assert::assertContains((string) $order->getId(), $orderIndex->getSalesOrderGrid()->getAllIds(), 'Order grid does not have ' . $order->getId() . ' in search results');
}
示例5: run
/**
* Create credit memo from order on backend.
*
* @return array
*/
public function run()
{
$this->orderIndex->open();
$this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $this->order->getId()]);
$this->salesOrderView->getPageActions()->orderCreditMemo();
if (!empty($this->data)) {
$this->orderCreditMemoNew->getFormBlock()->fillProductData($this->data, $this->order->getEntityId()['products']);
$this->orderCreditMemoNew->getFormBlock()->updateQty();
$this->orderCreditMemoNew->getFormBlock()->fillFormData($this->data);
}
$this->orderCreditMemoNew->getFormBlock()->submit();
return ['creditMemoIds' => $this->getCreditMemoIds()];
}
示例6: processAssert
/**
* Assert that comment about authorized amount exist in Comments History section on order page in backend.
*
* @param SalesOrderView $salesOrderView
* @param OrderIndex $salesOrder
* @param string $orderId
* @param array $prices
* @return void
*/
public function processAssert(SalesOrderView $salesOrderView, OrderIndex $salesOrder, $orderId, array $prices)
{
$salesOrder->open();
$salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]);
$actualAuthorizedAmount = $salesOrderView->getOrderHistoryBlock()->getCommentsHistory();
\PHPUnit_Framework_Assert::assertContains(self::AUTHORIZED_AMOUNT . $prices['grandTotal'], $actualAuthorizedAmount, 'Incorrect authorized amount value for the order #' . $orderId);
}
示例7: processAssert
/**
* Assert that status is correct on order page in backend (same with value of orderStatus variable)
*
* @param string $status
* @param string $orderId
* @param OrderIndex $salesOrder
* @param SalesOrderView $salesOrderView
* @param string|null $statusToCheck
* @return void
*/
public function processAssert($status, $orderId, OrderIndex $salesOrder, SalesOrderView $salesOrderView, $statusToCheck = null)
{
$salesOrder->open();
$salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]);
$orderStatus = $statusToCheck == null ? $status : $statusToCheck;
\PHPUnit_Framework_Assert::assertEquals($salesOrderView->getOrderForm()->getOrderInfoBlock()->getOrderStatus(), $orderStatus);
}
示例8: run
/**
* Create credit memo.
*
* @return array
*/
public function run()
{
$this->orderIndex->open();
$this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $this->order->getId()]);
/** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Invoices\Grid $invoicesGrid */
$invoicesGrid = $this->salesOrderView->getOrderForm()->getTab('invoices')->getGridBlock();
$this->salesOrderView->getOrderForm()->openTab('invoices');
$invoicesGrid->viewInvoice();
$this->salesOrderView->getPageActions()->orderInvoiceCreditMemo();
if (!empty($this->refundData)) {
$this->orderCreditMemoNew->getFormBlock()->fillProductData($this->refundData, $this->order->getEntityId()['products']);
$this->orderCreditMemoNew->getFormBlock()->updateQty();
}
$this->orderCreditMemoNew->getFormBlock()->submit();
return ['ids' => ['creditMemoIds' => $this->getCreditMemoIds()]];
}
示例9: processAssert
/**
* Assert that order with fixture data in not more in the Orders grid
*
* @param OrderInjectable $order
* @param OrderIndex $orderIndex
* @return void
*/
public function processAssert(OrderInjectable $order, OrderIndex $orderIndex)
{
$data = $order->getData();
$filter = ['id' => $data['id']];
$orderIndex->open();
$errorMessage = implode(', ', $filter);
\PHPUnit_Framework_Assert::assertFalse($orderIndex->getSalesOrderGrid()->isRowVisible($filter), 'Order with following data \'' . $errorMessage . '\' is present in Orders grid.');
}
示例10: processAssert
/**
* Assert that comment about captured amount exist in Comments History section on order page in Admin.
*
* @param SalesOrderView $salesOrderView
* @param OrderIndex $salesOrder
* @param string $orderId
* @param array $capturedPrices
* @return void
*/
public function processAssert(SalesOrderView $salesOrderView, OrderIndex $salesOrder, $orderId, array $capturedPrices)
{
$salesOrder->open();
$salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]);
$actualCapturedAmount = $salesOrderView->getOrderHistoryBlock()->getCapturedAmount();
foreach ($capturedPrices as $key => $capturedPrice) {
\PHPUnit_Framework_Assert::assertContains(self::CAPTURED_AMOUNT . $capturedPrice, $actualCapturedAmount[$key], 'Incorrect captured amount value for the order #' . $orderId);
}
}
示例11: 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.');
}
}
示例12: processAssert
/**
* Assert that refund is present in the tab with ID and refunded amount(depending on full/partial refund).
*
* @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('creditmemos');
/** @var Grid $grid */
$grid = $salesOrderView->getOrderForm()->getTab('creditmemos')->getGridBlock();
$amount = $order->getPrice();
foreach ($ids['creditMemoIds'] as $key => $creditMemoId) {
$filter = ['id' => $creditMemoId, 'amount_from' => $amount[$key]['grand_creditmemo_total'], 'amount_to' => $amount[$key]['grand_creditmemo_total']];
\PHPUnit_Framework_Assert::assertTrue($grid->isRowVisible($filter, true, false), 'Credit memo is absent on credit memos tab.');
}
}
示例13: processAssert
/**
* Assert that buttons from dataset are not present on page
*
* @param OrderIndex $orderIndex
* @param SalesOrderView $salesOrderView
* @param OrderInjectable $order
* @param string $orderButtonsUnavailable
* @return void
*/
public function processAssert(OrderIndex $orderIndex, SalesOrderView $salesOrderView, OrderInjectable $order, $orderButtonsUnavailable)
{
$orderIndex->open();
$orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]);
$buttons = explode(',', $orderButtonsUnavailable);
$matches = [];
foreach ($buttons as $button) {
if ($salesOrderView->getPageActions()->isActionButtonVisible(trim($button))) {
$matches[] = $button;
}
}
\PHPUnit_Framework_Assert::assertEmpty($matches, 'Buttons are present on order page.' . "\nLog:\n" . implode(";\n", $matches));
}
示例14: processAssert
/**
* @param $orderId
* @param OrderIndex $orderIndex
* @param SalesOrderView $salesOrderView
* @param BraintreeSettlementReportIndex $braintreeSettlementReportIndex
* @throws \Exception
*/
public function processAssert($orderId, OrderIndex $orderIndex, SalesOrderView $salesOrderView, BraintreeSettlementReportIndex $braintreeSettlementReportIndex)
{
$this->salesOrderView = $salesOrderView;
$this->settlementReportIndex = $braintreeSettlementReportIndex;
$orderIndex->open();
$orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]);
$transactionId = $this->getTransactionId();
\PHPUnit_Framework_Assert::assertNotEmpty($transactionId);
$this->settlementReportIndex->open();
$grid = $this->settlementReportIndex->getSettlementReportGrid();
$grid->search(['id' => $transactionId]);
$ids = $grid->getTransactionIds();
\PHPUnit_Framework_Assert::assertTrue(in_array($transactionId, $ids));
}
示例15: run
/**
* Create invoice (with shipment optionally) for order on backend.
*
* @return array
*/
public function run()
{
$this->orderIndex->open();
$this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $this->order->getId()]);
$this->salesOrderView->getPageActions()->invoice();
if (!empty($this->data)) {
$this->orderInvoiceNew->getFormBlock()->fillData($this->data, $this->order->getEntityId()['products']);
$this->orderInvoiceNew->getFormBlock()->updateQty();
}
$this->orderInvoiceNew->getFormBlock()->submit();
$invoiceIds = $this->getInvoiceIds();
if (!empty($this->data)) {
$shipmentIds = $this->getShipmentIds();
}
return ['invoiceIds' => $invoiceIds, 'shipmentIds' => isset($shipmentIds) ? $shipmentIds : null];
}