当前位置: 首页>>代码示例>>PHP>>正文


PHP OrderIndex::open方法代码示例

本文整理汇总了PHP中magento\sales\test\page\adminhtml\OrderIndex::open方法的典型用法代码示例。如果您正苦于以下问题:PHP OrderIndex::open方法的具体用法?PHP OrderIndex::open怎么用?PHP OrderIndex::open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在magento\sales\test\page\adminhtml\OrderIndex的用法示例。


在下文中一共展示了OrderIndex::open方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processAssert

 /**
  * Assert that message from dataset is displayed on order(s) view page on backend.
  *
  * @param GiftMessage $giftMessage
  * @param SalesOrderView $salesOrderView
  * @param OrderIndex $orderIndex
  * @param FixtureFactory $fixtureFactory
  * @param array $products
  * @param string $orderId
  * @return void
  */
 public function processAssert(GiftMessage $giftMessage, SalesOrderView $salesOrderView, OrderIndex $orderIndex, FixtureFactory $fixtureFactory, array $products, $orderId)
 {
     $expectedData = [];
     $actualData = [];
     $orderIndex->open()->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]);
     if ($giftMessage->getAllowGiftMessagesForOrder() === 'Yes') {
         $formData = ['sender' => $giftMessage->getSender(), 'recipient' => $giftMessage->getRecipient(), 'message' => $giftMessage->getMessage()];
         $giftMessageForm = $fixtureFactory->createByCode('giftMessage', ['data' => $formData]);
         $expectedData[] = $giftMessageForm->getData();
         $actualData[] = $salesOrderView->getGiftOptionsBlock()->getData($giftMessageForm);
     }
     if ($giftMessage->getAllowGiftOptionsForItems() === 'Yes') {
         foreach ($giftMessage->getItems() as $key => $giftMessageItem) {
             $expectedData[] = $giftMessageItem->getData();
             $product = $products[$key];
             $actualData[] = $salesOrderView->getGiftItemsBlock()->getItemProduct($product)->getGiftMessageFormData($giftMessage);
         }
     }
     $errors = $this->verifyData($expectedData, $actualData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:32,代码来源:AssertGiftMessageInBackendOrder.php

示例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()];
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:16,代码来源:HoldCreatedOrderTest.php

示例3: 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)];
 }
开发者ID:opexsw,项目名称:magento2,代码行数:19,代码来源:MassOrdersUpdateTest.php

示例4: 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()];
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:CreateShipmentStep.php

示例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()];
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:18,代码来源:CreateCreditMemoStep.php

示例6: 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);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:17,代码来源:AssertOrderStatusIsCorrect.php

示例7: processAssert

 /**
  * Assert that orders are present in Sales -> Orders Grid
  *
  * @param OrderInjectable[] $orders
  * @param OrderIndex $orderIndex
  * @param array $orderStatuses
  * @param AssertOrderInOrdersGrid $assertOrderInOrdersGrid
  * @return void
  */
 public function processAssert($orders, OrderIndex $orderIndex, array $orderStatuses, AssertOrderInOrdersGrid $assertOrderInOrdersGrid)
 {
     $orderIndex->open();
     foreach ($orders as $key => $order) {
         $assertOrderInOrdersGrid->assert($order, $orderIndex, $orderStatuses[$key]);
     }
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:AssertOrdersInOrdersGrid.php

示例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()]];
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:21,代码来源:CreateBraintreeCreditMemoStep.php

示例9: 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);
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:16,代码来源:AssertOrderCommentsHistory.php

示例10: tearDown

 /**
  * Change created order status and unassign custom order status if order was created.
  *
  * @return void
  */
 public function tearDown()
 {
     if ($this->order->hasData('id')) {
         $this->orderIndex->open()->getSalesOrderGrid()->massaction([['id' => $this->order->getId()]], 'Cancel');
         $filter = ['label' => $this->orderStatus->getLabel(), 'status' => $this->orderStatusInitial->getStatus()];
         $this->orderStatusIndex->open()->getOrderStatusGrid()->searchAndUnassign($filter);
     }
 }
开发者ID:opexsw,项目名称:magento2,代码行数:13,代码来源:UpdateCustomOrderStatusTest.php

示例11: 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.');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:15,代码来源:AssertOrderNotInOrdersGrid.php

示例12: 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);
     }
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:18,代码来源:AssertCaptureInCommentsHistory.php

示例13: tearDown

 /**
  * Change created order status and unassign custom order status if order was created.
  *
  * @return void
  */
 public function tearDown()
 {
     if ($this->order->hasData('id')) {
         $this->orderIndex->open()->getSalesOrderGrid()->massaction([['id' => $this->order->getId()]], 'Cancel');
         $filter = ['label' => $this->orderStatus->getLabel(), 'status' => $this->orderStatusInitial->getStatus()];
         $this->orderStatusIndex->open()->getOrderStatusGrid()->searchAndUnassign($filter);
         $this->objectManager->create('Magento\\Config\\Test\\TestStep\\SetupConfigurationStep', ['configData' => 'checkmo_custom_new_order_status_rollback'])->run();
     }
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:14,代码来源:UpdateCustomOrderStatusTest.php

示例14: processAssert

 /**
  * Assert that deleted customers address is not displayed on backend during order creation
  *
  * @param OrderIndex $orderIndex
  * @param OrderCreateIndex $orderCreateIndex
  * @param Address $deletedAddress
  * @param Customer $customer
  * @return void
  */
 public function processAssert(OrderIndex $orderIndex, OrderCreateIndex $orderCreateIndex, Address $deletedAddress, Customer $customer)
 {
     $filter = ['email' => $customer->getEmail()];
     $orderIndex->open()->getGridPageActions()->addNew();
     $orderCreateIndex->getCustomerBlock()->searchAndOpen($filter);
     $orderCreateIndex->getStoreBlock()->selectStoreView();
     $actualAddresses = $orderCreateIndex->getCreateBlock()->getBillingAddressBlock()->getExistingAddresses();
     $addressRenderer = $this->objectManager->create('Magento\\Customer\\Test\\Block\\Address\\Renderer', ['address' => $deletedAddress]);
     $addressToSearch = $addressRenderer->render();
     \PHPUnit_Framework_Assert::assertFalse(in_array($addressToSearch, $actualAddresses), 'Deleted address is present on backend during order creation');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:20,代码来源:AssertAddressDeletedBackend.php

示例15: 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.');
     }
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:21,代码来源:AssertShipmentInShipmentsTab.php


注:本文中的magento\sales\test\page\adminhtml\OrderIndex::open方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。