本文整理匯總了PHP中Magento\Sales\Test\Fixture\OrderInjectable::getDataFieldConfig方法的典型用法代碼示例。如果您正苦於以下問題:PHP OrderInjectable::getDataFieldConfig方法的具體用法?PHP OrderInjectable::getDataFieldConfig怎麽用?PHP OrderInjectable::getDataFieldConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Sales\Test\Fixture\OrderInjectable
的用法示例。
在下文中一共展示了OrderInjectable::getDataFieldConfig方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: 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());
}
}
示例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: 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());
}
}
示例4: test
/**
* Move last ordered products on order page.
*
* @param OrderInjectable $order
* @return array
*/
public function test(OrderInjectable $order)
{
// Preconditions:
$order->persist();
$customer = $order->getDataFieldConfig('customer_id')['source']->getCustomer();
// Steps:
$this->customerIndex->open();
$this->customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $customer->getEmail()]);
$this->customerIndexEdit->getPageActionsBlock()->createOrder();
$this->orderCreateIndex->getStoreBlock()->selectStoreView();
$products = $order->getEntityId()['products'];
$activitiesBlock = $this->orderCreateIndex->getCustomerActivitiesBlock();
$activitiesBlock->getLastOrderedItemsBlock()->addProductsToOrder($products);
$activitiesBlock->updateChanges();
return ['products' => $products];
}
示例5: test
/**
* Automatic Apply Tax Based on VAT ID.
*
* @param ConfigData $vatConfig
* @param OrderInjectable $order
* @param TaxRule $taxRule
* @param Cart $cart
* @param string $configData
* @param string $customerGroup
* @return array
*/
public function test(ConfigData $vatConfig, OrderInjectable $order, TaxRule $taxRule, Cart $cart, $configData, $customerGroup)
{
// Preconditions
$this->configData = $configData;
$this->objectManager->create('Magento\\Config\\Test\\TestStep\\SetupConfigurationStep', ['configData' => $this->configData])->run();
$taxRule->persist();
// Prepare data
$this->customer = $order->getDataFieldConfig('customer_id')['source']->getCustomer();
$address = $this->customer->getDataFieldConfig('address')['source']->getAddresses()[0];
$this->prepareVatConfig($vatConfig, $customerGroup);
$poducts = $order->getEntityId()['products'];
$cart = $this->fixtureFactory->createByCode('cart', ['data' => array_merge($cart->getData(), ['items' => ['products' => $poducts]])]);
// Steps
$order->persist();
$this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $this->customer])->run();
$this->objectManager->create('Magento\\Checkout\\Test\\TestStep\\AddProductsToTheCartStep', $order->getEntityId())->run();
$this->checkoutCart->open();
$this->checkoutCart->getCartBlock()->waitCartContainerLoading();
$this->checkoutCart->getShippingBlock()->fillEstimateShippingAndTax($address);
$this->checkoutCart->getCartBlock()->waitCartContainerLoading();
return ['customer' => $this->customer, 'address' => $address, 'orderId' => $order->getId(), 'cart' => $cart, 'products' => $poducts];
}
示例6: test
/**
* Run Update Custom OrderStatus Test.
*
* @param OrderStatus $orderStatusInitial
* @param OrderStatus $orderStatus
* @param OrderInjectable $order
* @param FixtureFactory $fixtureFactory
* @param string $orderExist
* @return array
*/
public function test(OrderStatus $orderStatusInitial, OrderStatus $orderStatus, OrderInjectable $order, FixtureFactory $fixtureFactory, $orderExist)
{
// Preconditions:
$orderStatusInitial->persist();
if ($orderExist == 'Yes') {
$config = $fixtureFactory->createByCode('configData', ['dataset' => 'checkmo_custom_new_order_status', 'data' => ['payment/checkmo/order_status' => ['value' => $orderStatusInitial->getStatus()]]]);
$config->persist();
$order->persist();
}
// Steps:
$this->orderStatusIndex->open();
$this->orderStatusIndex->getOrderStatusGrid()->searchAndOpen(['label' => $orderStatusInitial->getLabel()]);
$this->orderStatusEdit->getOrderStatusForm()->fill($orderStatus);
$this->orderStatusEdit->getFormPageActions()->save();
// Configuring orderStatus for asserts.
$orderStatus = $fixtureFactory->createByCode('orderStatus', ['data' => array_merge($orderStatusInitial->getData(), $orderStatus->getData())]);
// Prepare data for tear down
$this->orderStatus = $orderStatus;
$this->orderStatusInitial = $orderStatusInitial;
$this->order = $order;
return ['orderStatus' => $orderStatus, 'status' => $orderStatus->getLabel(), 'customer' => $order->getDataFieldConfig('customer_id')['source']->getCustomer()];
}
示例7: test
/**
* Run Assign Custom OrderStatus.
*
* @param OrderStatus $orderStatus
* @param OrderInjectable $order
* @param array $orderStatusState
* @param AssertOrderStatusSuccessAssignMessage $assertion
* @return array
*/
public function test(OrderStatus $orderStatus, OrderInjectable $order, array $orderStatusState, AssertOrderStatusSuccessAssignMessage $assertion)
{
// Preconditions:
$orderStatus->persist();
/** @var OrderStatus $orderStatus */
$orderStatus = $this->fixtureFactory->createByCode('orderStatus', ['data' => array_merge($orderStatus->getData(), $orderStatusState)]);
$this->orderStatus = $orderStatus;
// Steps:
$this->orderStatusIndex->open();
$this->orderStatusIndex->getGridPageActions()->assignStatusToState();
$this->orderStatusAssign->getAssignForm()->fill($orderStatus);
$this->orderStatusAssign->getPageActionsBlock()->save();
$assertion->processAssert($this->orderStatusIndex);
$order->persist();
$this->order = $order;
return ['orderId' => $order->getId(), 'customer' => $order->getDataFieldConfig('customer_id')['source']->getCustomer(), 'status' => $orderStatus->getLabel()];
}
示例8: prepareCustomerData
/**
* Prepare customer data.
*
* @param array $data
* @return array
*/
protected function prepareCustomerData(array $data)
{
return ['currency_id' => $data['base_currency_code'], 'customer_id' => $this->customer->getData('id'), 'payment' => $data['payment_authorization_amount'], 'store_id' => $this->order->getDataFieldConfig('store_id')['source']->store->getStoreId()];
}
示例9: openDownloadableLink
/**
* Open Downloadable Link.
*
* @param OrderInjectable $order
* @param int $downloads
* @return void
*/
protected function openDownloadableLink(OrderInjectable $order, $downloads)
{
$customerLogin = $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $order->getDataFieldConfig('customer_id')['source']->getCustomer()]);
$customerLogin->run();
$this->customerAccount->getAccountMenuBlock()->openMenuItem('My Downloadable Products');
$downloadableProductsUrl = $this->browser->getUrl();
foreach ($order->getEntityId()['products'] as $product) {
foreach ($product->getDownloadableLinks()['downloadable']['link'] as $link) {
for ($i = 0; $i < $downloads; $i++) {
$this->browser->open($this->customerProducts->getMainBlock()->getLinkUrl($link['title']));
$this->browser->open($downloadableProductsUrl);
}
}
}
}