• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Fixture\OrderInjectable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Magento\Sales\Test\Fixture\OrderInjectable的典型用法代码示例。如果您正苦于以下问题:PHP OrderInjectable类的具体用法?PHP OrderInjectable怎么用?PHP OrderInjectable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: processAssert

 /**
  * Assert order is not visible in customer account on frontend
  *
  * @param OrderInjectable $order
  * @param Customer $customer
  * @param CustomerAccountIndex $customerAccountIndex
  * @param OrderHistory $orderHistory
  * @param string $status
  * @return void
  */
 public function processAssert(OrderInjectable $order, Customer $customer, CustomerAccountIndex $customerAccountIndex, OrderHistory $orderHistory, $status)
 {
     $filter = ['id' => $order->getId(), 'status' => $status];
     $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     $customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Orders');
     \PHPUnit_Framework_Assert::assertFalse($orderHistory->getOrderHistoryBlock()->isVisible() && $orderHistory->getOrderHistoryBlock()->isOrderVisible($filter), 'Order with following data \'' . implode(', ', $filter) . '\' is present in Orders block on frontend.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:17,代码来源:AssertOrderNotVisibleOnMyAccount.php


示例2: processAssert

 /**
  * Assert bestseller info in report: date, product name and qty.
  *
  * @param Bestsellers $bestsellers
  * @param OrderInjectable $order
  * @param string $date
  * @return void
  */
 public function processAssert(Bestsellers $bestsellers, OrderInjectable $order, $date)
 {
     /** @var CatalogProductSimple $product */
     $product = $order->getEntityId()['products'][0];
     $filter = ['date' => date($date), 'product' => $product->getName(), 'price' => $product->getPrice(), 'orders' => $product->getCheckoutData()['qty']];
     \PHPUnit_Framework_Assert::assertTrue($bestsellers->getGridBlock()->isRowVisible($filter, false), 'Bestseller does not present in report grid.');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:15,代码来源:AssertBestsellerReportResult.php


示例3: test

 /**
  * Create invoice.
  *
  * @param OrderInjectable $order
  * @param array $data
  * @return array
  */
 public function test(OrderInjectable $order, array $data)
 {
     // Preconditions
     $order->persist();
     // Steps
     $result = $this->objectManager->create('Magento\\Sales\\Test\\TestStep\\CreateInvoiceStep', ['order' => $order, 'data' => $data])->run();
     return ['ids' => ['invoiceIds' => $result['invoiceIds'], 'shipmentIds' => isset($result['shipmentIds']) ? $result['shipmentIds'] : null]];
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:15,代码来源:CreateInvoiceEntityTest.php


示例4: processAssert

 /**
  * Assert coupon info in report: code, rule name, subtotal, discount on coupons report page
  *
  * @param SalesCouponReportView $salesCouponReportView
  * @param OrderInjectable $order
  * @param string $currency
  * @return void
  */
 public function processAssert(SalesCouponReportView $salesCouponReportView, OrderInjectable $order, $currency = '$')
 {
     $data = $order->getData();
     $discount = $data['price']['discount'] != 0 ? '-' . $currency . number_format($data['price']['discount'], 2) : $currency . '0.00';
     $couponCode = $data['coupon_code']->getCouponCode();
     $filter = ['coupon_code' => $couponCode, 'rule_name' => $data['coupon_code']->getName(), 'subtotal' => $currency . number_format($data['price']['subtotal'], 2), 'discount' => $discount];
     \PHPUnit_Framework_Assert::assertTrue($salesCouponReportView->getGridBlock()->isRowVisible($filter, false), "Coupon with code - '{$couponCode}' is not visible.");
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:AssertCouponReportResult.php


示例5: processAssert

 /**
  * Assert that order is present in Orders grid on frontend.
  *
  * @param OrderInjectable $order
  * @param Customer $customer
  * @param ObjectManager $objectManager
  * @param CustomerAccountIndex $customerAccountIndex
  * @param OrderHistory $orderHistory
  * @param string $status
  * @param string $orderId
  * @param string|null $statusToCheck
  * @return void
  */
 public function processAssert(OrderInjectable $order, Customer $customer, ObjectManager $objectManager, CustomerAccountIndex $customerAccountIndex, OrderHistory $orderHistory, $status, $orderId = '', $statusToCheck = null)
 {
     $filter = ['id' => $order->hasData('id') ? $order->getId() : $orderId, 'status' => $statusToCheck === null ? $status : $statusToCheck];
     $objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     $customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Orders');
     $errorMessage = implode(', ', $filter);
     \PHPUnit_Framework_Assert::assertTrue($orderHistory->getOrderHistoryBlock()->isOrderVisible($filter), 'Order with following data \'' . $errorMessage . '\' is absent in Orders block on frontend.');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:21,代码来源:AssertOrderInOrdersGridOnFrontend.php


示例6: 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


示例7: test

 /**
  * Create invoice.
  *
  * @param OrderInjectable $order
  * @param array $data
  * @return array
  */
 public function test(OrderInjectable $order, array $data)
 {
     // Preconditions
     $order->persist();
     // Steps
     $result = $this->objectManager->create('Magento\\Sales\\Test\\TestStep\\CreateInvoiceStep', ['order' => $order, 'data' => $data])->run();
     return $result;
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:15,代码来源:CreateInvoiceEntityTest.php


示例8: test

 /**
  * Search order products report.
  *
  * @param OrderInjectable $order
  * @param array $customersReport
  * @return void
  */
 public function test(OrderInjectable $order, array $customersReport)
 {
     // Preconditions
     $order->persist();
     // Steps
     $this->orderedProducts->open();
     $this->orderedProducts->getGridBlock()->searchAccounts($customersReport);
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:15,代码来源:OrderedProductsReportEntityTest.php


示例9: test

 /**
  * Create shipment.
  *
  * @param OrderInjectable $order
  * @param array $data
  * @return array
  */
 public function test(OrderInjectable $order, array $data)
 {
     // Preconditions
     $order->persist();
     // Steps
     $createShipping = $this->objectManager->create('Magento\\Sales\\Test\\TestStep\\CreateShipmentStep', ['order' => $order, 'data' => $data]);
     return ['ids' => $createShipping->run()];
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:15,代码来源:CreateShipmentEntityTest.php


示例10: processAssert

 /**
  * Assert that invoiced Grand Total amount is equal to placed order Grand total amount on invoice page (frontend)
  *
  * @param OrderHistory $orderHistory
  * @param OrderInjectable $order
  * @param CustomerOrderView $customerOrderView
  * @param InvoiceView $invoiceView
  * @param array $ids
  * @return void
  */
 public function processAssert(OrderHistory $orderHistory, OrderInjectable $order, CustomerOrderView $customerOrderView, InvoiceView $invoiceView, array $ids)
 {
     $this->loginCustomerAndOpenOrderPage($order->getDataFieldConfig('customer_id')['source']->getCustomer());
     $orderHistory->getOrderHistoryBlock()->openOrderById($order->getId());
     $customerOrderView->getOrderViewBlock()->openLinkByName('Invoices');
     foreach ($ids['invoiceIds'] as $key => $invoiceId) {
         \PHPUnit_Framework_Assert::assertEquals(number_format($order->getPrice()[$key]['grand_invoice_total'], 2), $invoiceView->getInvoiceBlock()->getItemBlock($invoiceId)->getGrandTotal());
     }
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:19,代码来源:AssertInvoicedAmountOnFrontend.php


示例11: getOrdersResults

 /**
  * Get orders quantity from Ordered Products Report grid
  *
  * @param OrderInjectable $order
  * @return array
  */
 public function getOrdersResults(OrderInjectable $order)
 {
     $products = $order->getEntityId()['products'];
     $views = [];
     foreach ($products as $key => $product) {
         $views[$key] = $this->_rootElement->find(sprintf($this->product, $product->getName()), Locator::SELECTOR_XPATH)->getText();
     }
     return $views;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:15,代码来源:Grid.php


示例12: 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


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


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


示例15: prepareOrderProducts

 /**
  * Prepare order products
  *
  * @param OrderInjectable $order
  * @param array|null $data [optional]
  * @return array
  */
 protected function prepareOrderProducts(OrderInjectable $order, array $data = null)
 {
     $products = $order->getEntityId()['products'];
     $productsData = [];
     /** @var CatalogProductSimple $product */
     foreach ($products as $key => $product) {
         $productsData[] = ['product' => $product->getName(), 'sku' => $product->getSku(), 'qty' => isset($data[$key]['qty']) && $data[$key]['qty'] != '-' ? $data[$key]['qty'] : $product->getCheckoutData()['qty']];
     }
     return $this->sortDataByPath($productsData, $this->sortKey);
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:17,代码来源:AbstractAssertItems.php


示例16: test

 /**
  * Bestseller Products Report.
  *
  * @param OrderInjectable $order
  * @param array $bestsellerReport
  * @return void
  */
 public function test(OrderInjectable $order, array $bestsellerReport)
 {
     // Preconditions
     $order->persist();
     $this->bestsellers->open();
     $this->bestsellers->getMessagesBlock()->clickLinkInMessages('notice', 'here');
     // Steps
     $this->bestsellers->getFilterBlock()->viewsReport($bestsellerReport);
     $this->bestsellers->getActionsBlock()->showReport();
 }
开发者ID:niranjanssiet,项目名称:magento2,代码行数:17,代码来源:BestsellerProductsReportEntityTest.php


示例17: processAssert

 /**
  * Assert that ordered products in bestsellers on Dashboard successfully refreshed.
  *
  * @param OrderInjectable $order
  * @param Dashboard $dashboard
  * @return void
  */
 public function processAssert(OrderInjectable $order, Dashboard $dashboard)
 {
     $dashboard->open();
     $dashboard->getStoreStatsBlock()->refreshData();
     /** @var \Magento\Backend\Test\Block\Dashboard\Tab\Products\Ordered $bestsellersGrid */
     $bestsellersGrid = $dashboard->getStoreStatsBlock()->getTabElement('bestsellers')->getBestsellersGrid();
     $products = $order->getEntityId()['products'];
     foreach ($products as $product) {
         \PHPUnit_Framework_Assert::assertTrue($bestsellersGrid->isProductVisible($product), 'Bestseller ' . $product->getName() . ' is not present in report grid after refresh data.');
     }
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:18,代码来源:AssertBestsellersOnDashboard.php


示例18: processAssert

 /**
  * Assert bestseller info in report: date, product name and qty
  *
  * @param Bestsellers $bestsellers
  * @param OrderInjectable $order
  * @param string $date
  * @return void
  *
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function processAssert(Bestsellers $bestsellers, OrderInjectable $order, $date)
 {
     $products = $order->getEntityId()['products'];
     $totalQuantity = $bestsellers->getGridBlock()->getViewsResults($products, $date);
     $productQty = [];
     foreach ($products as $key => $product) {
         /** @var CatalogProductSimple $product*/
         $productQty[$key] = $product->getCheckoutData()['qty'];
     }
     \PHPUnit_Framework_Assert::assertEquals($productQty, $totalQuantity);
 }
开发者ID:zhangjiachao,项目名称:magento2,代码行数:21,代码来源:AssertBestsellerReportResult.php


示例19: assert

 /**
  * Process assert.
  *
  * @param OrderInjectable $order
  * @param array $ids
  * @param SalesShipmentView $salesShipmentView
  * @param array|null $data [optional]
  * @return void
  */
 protected function assert(OrderInjectable $order, array $ids, SalesShipmentView $salesShipmentView, array $data = null)
 {
     $orderId = $order->getId();
     $productsData = $this->prepareOrderProducts($order, $data['items_data']);
     foreach ($ids['shipmentIds'] as $shipmentId) {
         $filter = ['order_id' => $orderId, 'id' => $shipmentId];
         $this->shipmentPage->getShipmentsGrid()->searchAndOpen($filter);
         $itemsData = $this->preparePageItems($salesShipmentView->getItemsBlock()->getData());
         $error = $this->verifyData($productsData, $itemsData);
         \PHPUnit_Framework_Assert::assertEmpty($error, $error);
     }
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:21,代码来源:AssertShipmentItems.php


示例20: processAssert

 /**
  * Assert product info in report: product name, link title, sku, downloads number (Reports > Products > Downloads)
  *
  * @param OrderInjectable $order
  * @param DownloadsReport $downloadsReport
  * @param int $downloads
  * @return void
  */
 public function processAssert(OrderInjectable $order, DownloadsReport $downloadsReport, $downloads)
 {
     $downloadsReport->open();
     foreach ($order->getEntityId()['products'] as $product) {
         foreach ($product->getDownloadableLinks()['downloadable']['link'] as $link) {
             $filter = ['name' => $product->getName(), 'link_title' => $link['title'], 'sku' => $product->getSku()];
             $downloadsReport->getGridBlock()->search($filter);
             $filter[] = $downloads;
             \PHPUnit_Framework_Assert::assertTrue($downloadsReport->getGridBlock()->isRowVisible($filter, false), "Downloads report link {$link['title']} is not present in reports grid.");
         }
     }
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:20,代码来源:AssertDownloadsReportResult.php



注:本文中的Magento\Sales\Test\Fixture\OrderInjectable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP adminhtml\OrderIndex类代码示例发布时间:2022-05-23
下一篇:
PHP Order\Payment类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap