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


PHP CustomerIndex::getCustomerGridBlock方法代码示例

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


在下文中一共展示了CustomerIndex::getCustomerGridBlock方法的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: 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

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

示例4: processAssert

 /**
  * Assert that customer name is present in search results
  *
  * @param Dashboard $dashboard
  * @param GlobalSearch $search
  * @param CustomerIndex $customerIndex
  * @return void
  */
 public function processAssert(Dashboard $dashboard, GlobalSearch $search, CustomerIndex $customerIndex)
 {
     $customer = $search->getDataFieldConfig('query')['source']->getEntity();
     $customerName = $customer->getFirstname() . " " . $customer->getLastname();
     $isVisibleInResult = $dashboard->getAdminPanelHeader()->isSearchResultVisible($customerName);
     \PHPUnit_Framework_Assert::assertTrue($isVisibleInResult, 'Customer name ' . $customerName . ' is absent in search results');
     $dashboard->getAdminPanelHeader()->navigateToGrid("Customers");
     $isCustomerGridVisible = $customerIndex->getCustomerGridBlock()->isVisible();
     \PHPUnit_Framework_Assert::assertTrue($isCustomerGridVisible, 'Customer grid is not visible');
     \PHPUnit_Framework_Assert::assertContains((string) $customer->getId(), $customerIndex->getCustomerGridBlock()->getAllIds(), 'Customer grid does not have ' . $customerName . ' in search results');
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:19,代码来源:AssertGlobalSearchCustomerName.php

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

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

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

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

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

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

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

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

示例13: processAssert

 /**
  * Asserts all Product Review variables in the reviews grid on customer page
  *
  * @param Customer $customer
  * @param Review $reviewInitial
  * @param Review $review
  * @param CustomerIndexEdit $customerIndexEdit
  * @param CustomerIndex $customerIndex
  * @param AssertProductReviewInGrid $assertProductReviewInGrid
  * @return void
  */
 public function processAssert(Customer $customer, Review $reviewInitial, Review $review, CustomerIndexEdit $customerIndexEdit, CustomerIndex $customerIndex, AssertProductReviewInGrid $assertProductReviewInGrid)
 {
     /** var CatalogProductSimple $product */
     $product = $reviewInitial->getDataFieldConfig('entity_id')['source']->getEntity();
     $customerIndex->open();
     $customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $customer->getEmail()]);
     $customerIndexEdit->getCustomerForm()->openTab('product_reviews');
     $filter = $assertProductReviewInGrid->prepareFilter($product, $this->prepareData($review, $reviewInitial));
     /** @var ReviewsGrid $reviewsGrid */
     $reviewsGrid = $customerIndexEdit->getCustomerForm()->getTab('product_reviews')->getReviewsGrid();
     $reviewsGrid->search($filter);
     unset($filter['visible_in']);
     \PHPUnit_Framework_Assert::assertTrue($reviewsGrid->isRowVisible($filter, false), 'Review is absent in Review grid on customer page.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:25,代码来源:AssertProductReviewInGridOnCustomerPage.php

示例14: processAssert

 /**
  * Assert that customer group find on account information page.
  *
  * @param FixtureFactory $fixtureFactory
  * @param CustomerGroup $customerGroup
  * @param CustomerIndexNew $customerIndexNew
  * @param CustomerIndex $customerIndex
  * @return void
  */
 public function processAssert(FixtureFactory $fixtureFactory, CustomerGroup $customerGroup, CustomerIndexNew $customerIndexNew, CustomerIndex $customerIndex)
 {
     /** @var Customer $customer */
     $customer = $fixtureFactory->createByCode('customer', ['dataset' => 'defaultBackend', 'data' => ['group_id' => ['customerGroup' => $customerGroup]]]);
     $filter = ['email' => $customer->getEmail()];
     $customerIndexNew->open();
     $customerIndexNew->getCustomerForm()->fillCustomer($customer);
     $customerIndexNew->getPageActionsBlock()->save();
     $customerIndex->getCustomerGridBlock()->searchAndOpen($filter);
     $customerFormData = $customerIndexNew->getCustomerForm()->getData($customer);
     $customerFixtureData = $customer->getData();
     $diff = array_diff($customerFixtureData, $customerFormData);
     \PHPUnit_Framework_Assert::assertTrue(empty($diff), "Customer group {$customerGroup->getCustomerGroupCode()} not in account information page.");
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:23,代码来源:AssertCustomerGroupOnCustomerForm.php

示例15: test

 /**
  * Delete product from customer wishlist 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]);
     //Steps
     $customerIndex->open();
     $customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $customer->getEmail()]);
     $customerForm = $customerIndexEdit->getCustomerForm();
     $customerForm->openTab('wishlist');
     $filter = ['product_name' => $product->getName()];
     $customerForm->getTab('wishlist')->getSearchGridBlock()->searchAndAction($filter, 'Delete');
     return ['products' => [$product]];
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:24,代码来源:DeleteProductFromCustomerWishlistOnBackendTest.php


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