當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CustomerIndex::open方法代碼示例

本文整理匯總了PHP中Magento\Customer\Test\Page\Adminhtml\CustomerIndex::open方法的典型用法代碼示例。如果您正苦於以下問題:PHP CustomerIndex::open方法的具體用法?PHP CustomerIndex::open怎麽用?PHP CustomerIndex::open使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Customer\Test\Page\Adminhtml\CustomerIndex的用法示例。


在下文中一共展示了CustomerIndex::open方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: test

 /**
  * Mass assign customer group
  *
  * @param Customer $customer
  * @param CustomerGroup $customerGroup
  * @return void
  */
 public function test(Customer $customer, CustomerGroup $customerGroup)
 {
     // Steps
     $customerGroup->persist();
     $this->customerIndex->open();
     $this->customerIndex->getCustomerGridBlock()->massaction([['email' => $customer->getEmail()]], [$this->customersGridActions => $customerGroup->getCustomerGroupCode()]);
 }
開發者ID:whoople,項目名稱:magento2-testing,代碼行數:14,代碼來源:MassAssignCustomerGroupTest.php

示例2: test

 /**
  * Create customer on backend.
  *
  * @param Customer $customer
  * @param string $customerAction
  * @param Address $address
  * @return void
  */
 public function test(Customer $customer, $customerAction, Address $address = null)
 {
     // Steps
     $this->pageCustomerIndex->open();
     $this->pageCustomerIndex->getPageActionsBlock()->addNew();
     $this->pageCustomerIndexNew->getCustomerForm()->fillCustomer($customer, $address);
     $this->pageCustomerIndexNew->getPageActionsBlock()->{$customerAction}();
 }
開發者ID:koliaGI,項目名稱:magento2,代碼行數:16,代碼來源:CreateCustomerBackendEntityTest.php

示例3: testDeleteCustomerBackendEntity

 /**
  * Runs Delete Customer Backend Entity test
  *
  * @param CustomerInjectable $customer
  * @return void
  */
 public function testDeleteCustomerBackendEntity(CustomerInjectable $customer)
 {
     // Preconditions:
     $customer->persist();
     // Steps:
     $filter = ['email' => $customer->getEmail()];
     $this->customerIndexPage->open();
     $this->customerIndexPage->getCustomerGridBlock()->searchAndOpen($filter);
     $this->customerIndexEditPage->getPageActionsBlock()->delete();
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:16,代碼來源:DeleteCustomerBackendEntityTest.php

示例4: test

 /**
  * Create customer on backend.
  *
  * @param Customer $customer
  * @param Address $address
  * @param string $customerAction
  * @return void
  */
 public function test(Customer $customer, Address $address, $customerAction)
 {
     // Prepare data
     $address = $address->hasData() ? $address : null;
     // Steps
     $this->pageCustomerIndex->open();
     $this->pageCustomerIndex->getPageActionsBlock()->addNew();
     $this->pageCustomerIndexNew->getCustomerForm()->fillCustomer($customer, $address);
     $this->pageCustomerIndexNew->getPageActionsBlock()->{$customerAction}();
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:18,代碼來源:CreateCustomerBackendEntityTest.php

示例5: test

 /**
  * New Accounts Report
  *
  * @param CustomerInjectable $customer
  * @param array $customersReport
  * @return void
  */
 public function test(CustomerInjectable $customer, array $customersReport)
 {
     // Preconditions
     $this->customerIndexPage->open();
     $this->customerIndexPage->getCustomerGridBlock()->massaction([], 'Delete', true, 'Select All');
     $customer->persist();
     // Steps
     $this->customerAccounts->open();
     $this->customerAccounts->getGridBlock()->searchAccounts($customersReport);
 }
開發者ID:buskamuza,項目名稱:magento2-skeleton,代碼行數:17,代碼來源:NewAccountsReportEntityTest.php

示例6: testCreateCustomerBackendEntity

 /**
  * @param CustomerInjectable $customer
  * @param AddressInjectable $address
  */
 public function testCreateCustomerBackendEntity(CustomerInjectable $customer, AddressInjectable $address)
 {
     // Prepare data
     $address = $address->hasData() ? $address : null;
     // Steps
     $this->pageCustomerIndex->open();
     $this->pageCustomerIndex->getPageActionsBlock()->addNew();
     $this->pageCustomerIndexNew->getCustomerForm()->fillCustomer($customer, $address);
     $this->pageCustomerIndexNew->getPageActionsBlock()->save();
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:14,代碼來源:CreateCustomerBackendEntityTest.php

示例7: test

 /**
  * Create customer on backend.
  *
  * @param Customer $customer
  * @return void
  */
 public function test(Customer $customer)
 {
     // Precondition
     $customer->persist();
     // Steps
     $this->pageCustomerIndex->open();
     $this->pageCustomerIndex->getPageActionsBlock()->addNew();
     $this->pageCustomerIndexNew->getCustomerForm()->fillCustomer($customer);
     $this->pageCustomerIndexNew->getPageActionsBlock()->save();
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:16,代碼來源:CreateExistingCustomerBackendEntity.php

示例8: testUpdateCustomerBackendEntity

 /**
  * Run update customer test.
  *
  * @param Customer $initialCustomer
  * @param Customer $customer
  * @param Address $address [optional]
  * @return void
  */
 public function testUpdateCustomerBackendEntity(Customer $initialCustomer, Customer $customer, Address $address = null)
 {
     // Precondition
     $initialCustomer->persist();
     // Steps
     $filter = ['email' => $initialCustomer->getEmail()];
     $this->customerIndexPage->open();
     $this->customerIndexPage->getCustomerGridBlock()->searchAndOpen($filter);
     $this->customerIndexEditPage->getCustomerForm()->updateCustomer($customer, $address);
     $this->customerIndexEditPage->getPageActionsBlock()->save();
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:19,代碼來源:UpdateCustomerBackendEntityTest.php

示例9: test

 /**
  * New Accounts Report.
  *
  * @param Customer $customer
  * @param array $customersReport
  * @return void
  */
 public function test(Customer $customer, array $customersReport)
 {
     $this->markTestIncomplete('Bug: MAGETWO-35037');
     // Preconditions
     $this->customerIndexPage->open();
     $this->customerIndexPage->getCustomerGridBlock()->massaction([], 'Delete', true, 'Select All');
     $customer->persist();
     // Steps
     $this->customerAccounts->open();
     $this->customerAccounts->getGridBlock()->searchAccounts($customersReport);
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:18,代碼來源:NewAccountsReportEntityTest.php

示例10: testUpdateCustomerBackendEntity

 /**
  * @param CustomerInjectable $initialCustomer
  * @param CustomerInjectable $customer
  * @param AddressInjectable $address
  */
 public function testUpdateCustomerBackendEntity(CustomerInjectable $initialCustomer, CustomerInjectable $customer, AddressInjectable $address)
 {
     // Prepare data
     $address = $address->hasData() ? $address : null;
     // Preconditions:
     $initialCustomer->persist();
     // Steps
     $filter = ['email' => $initialCustomer->getEmail()];
     $this->customerIndexPage->open();
     $this->customerIndexPage->getCustomerGridBlock()->searchAndOpen($filter);
     $this->customerIndexEditPage->getCustomerForm()->updateCustomer($customer, $address);
     $this->customerIndexEditPage->getPageActionsBlock()->save();
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:18,代碼來源:UpdateCustomerBackendEntityTest.php

示例11: test

 /**
  * Runs Delete Customer Backend Entity test
  *
  * @param int $customersQty
  * @param int $customersQtyToDelete
  * @return array
  */
 public function test($customersQty, $customersQtyToDelete)
 {
     // Preconditions:
     $customers = $this->createCustomers($customersQty);
     $deleteCustomers = [];
     for ($i = 0; $i < $customersQtyToDelete; $i++) {
         $deleteCustomers[] = ['email' => $customers[$i]->getEmail()];
     }
     // Steps:
     $this->customerIndexPage->open();
     $this->customerIndexPage->getCustomerGridBlock()->massaction($deleteCustomers, 'Delete', true);
     return ['customers' => $customers];
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:20,代碼來源:MassDeleteCustomerBackendEntityTest.php

示例12: 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];
 }
開發者ID:opexsw,項目名稱:magento2,代碼行數:22,代碼來源:MoveLastOrderedProductsOnOrderPageTest.php

示例13: processAssert

 /**
  * Assert customer availability in Customer Grid
  *
  * @param Customer $customer
  * @param CustomerIndex $pageCustomerIndex
  * @return void
  *
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 public function processAssert(Customer $customer, CustomerIndex $pageCustomerIndex)
 {
     $customer = $customer->getData();
     $name = (isset($customer['prefix']) ? $customer['prefix'] . ' ' : '') . $customer['firstname'] . (isset($customer['middlename']) ? ' ' . $customer['middlename'] : '') . ' ' . $customer['lastname'] . (isset($customer['suffix']) ? ' ' . $customer['suffix'] : '');
     $filter = ['name' => $name, 'email' => $customer['email']];
     $pageCustomerIndex->open();
     \PHPUnit_Framework_Assert::assertTrue($pageCustomerIndex->getCustomerGridBlock()->isRowVisible($filter), 'Customer with ' . 'name \'' . $filter['name'] . '\', ' . 'email \'' . $filter['email'] . '\' ' . 'is absent in Customer grid.');
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:17,代碼來源:AssertCustomerInGrid.php

示例14: processAssert

 /**
  * Assert that products added to wishlist are present on Customers account on backend.
  *
  * @param CustomerIndex $customerIndex
  * @param Customer $customer
  * @param CustomerIndexEdit $customerIndexEdit
  * @param InjectableFixture $product
  * @return void
  */
 public function processAssert(CustomerIndex $customerIndex, Customer $customer, CustomerIndexEdit $customerIndexEdit, InjectableFixture $product)
 {
     $customerIndex->open();
     $customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $customer->getEmail()]);
     $customerIndexEdit->getCustomerForm()->openTab('wishlist');
     /** @var \Magento\Wishlist\Test\Block\Adminhtml\Customer\Edit\Tab\Wishlist\Grid $wishlistGrid */
     $wishlistGrid = $customerIndexEdit->getCustomerForm()->getTab('wishlist')->getSearchGridBlock();
     \PHPUnit_Framework_Assert::assertTrue($wishlistGrid->isRowVisible(['product_name' => $product->getName()]), $product->getName() . " is not visible in customer wishlist on backend.");
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:18,代碼來源:AssertProductIsPresentInCustomerBackendWishlist.php

示例15: test

 /**
  * Configure customer wish list on backend.
  *
  * @param Customer $customer
  * @param string $product
  * @param CustomerIndex $customerIndex
  * @param CustomerIndexEdit $customerIndexEdit
  * @return array
  */
 public function test(Customer $customer, $product, CustomerIndex $customerIndex, CustomerIndexEdit $customerIndexEdit)
 {
     // Preconditions
     $product = $this->createProducts($product)[0];
     $this->loginCustomer($customer);
     $this->addToWishlist([$product], true);
     // Steps
     $customerIndex->open();
     $customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $customer->getEmail()]);
     $customerIndexEdit->getCustomerForm()->openTab('wishlist');
     return ['product' => $product];
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:21,代碼來源:ViewProductInCustomerWishlistOnBackendTest.php


注:本文中的Magento\Customer\Test\Page\Adminhtml\CustomerIndex::open方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。