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


PHP Customer::persist方法代碼示例

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


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

示例1: run

 /**
  * Create customer
  *
  * @return array
  */
 public function run()
 {
     if ($this->persistCustomer) {
         $this->customer->persist();
     }
     return ['customer' => $this->customer];
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:12,代碼來源:CreateCustomerStep.php

示例2: processAssert

 /**
  * Assertion that tier prices are displayed correctly for specified customer
  *
  * @param BrowserInterface $browser
  * @param CatalogProductView $catalogProductView
  * @param FixtureInterface $product
  * @param Customer $customer
  * @return void
  */
 public function processAssert(BrowserInterface $browser, CatalogProductView $catalogProductView, FixtureInterface $product, Customer $customer)
 {
     $customer->persist();
     $this->loginCustomer($customer);
     $productTierPriceAssert = $this->objectManager->get('Magento\\Catalog\\Test\\Constraint\\AssertProductTierPriceOnProductPage');
     $productTierPriceAssert->processAssert($browser, $catalogProductView, $product);
 }
開發者ID:hientruong90,項目名稱:magento2_installer,代碼行數:16,代碼來源:AssertProductTierPriceOnProductPageWithCustomer.php

示例3: test

 /**
  * Create customer.
  *
  * @param Customer $customer
  * @param CustomerAccountForgotPassword $forgotPassword
  * @return void
  */
 public function test(Customer $customer, CustomerAccountForgotPassword $forgotPassword)
 {
     // Precondition
     $customer->persist();
     // Steps
     $forgotPassword->open();
     $forgotPassword->getForgotPasswordForm()->resetForgotPassword($customer);
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:15,代碼來源:ForgotPasswordOnFrontendTest.php

示例4: test

 /**
  * Run reset customer password failed test.
  * @param Customer $customer
  * @param int $attempts
  * @return void
  */
 public function test(Customer $customer, $attempts)
 {
     // Steps
     $customer->persist();
     for ($i = 0; $i < $attempts; $i++) {
         $this->forgotPassword->open();
         $this->forgotPassword->getForgotPasswordForm()->resetForgotPassword($customer);
     }
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:15,代碼來源:ResetCustomerPasswordFailedTest.php

示例5: __inject

 /**
  * Injection data
  *
  * @param CustomerAccountCreate $customerAccountCreate
  * @param CustomerAccountLogout $customerAccountLogout
  * @param CmsIndex $cmsIndex
  * @param Customer $customer
  * @return array
  */
 public function __inject(CustomerAccountCreate $customerAccountCreate, CustomerAccountLogout $customerAccountLogout, CmsIndex $cmsIndex, Customer $customer)
 {
     $this->customerAccountLogout = $customerAccountLogout;
     $this->customerAccountCreate = $customerAccountCreate;
     $this->cmsIndex = $cmsIndex;
     //Precondition
     $customer->persist();
     return ['customer' => $customer];
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:18,代碼來源:CreateExistingCustomerFrontendEntity.php

示例6: test

 /**
  * Create product and add it to cart.
  *
  * @param string $products
  * @param Customer $customer
  * @return array
  */
 public function test($products, Customer $customer)
 {
     // Precondition
     $products = $this->createProducts($products);
     $customer->persist();
     $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     $this->addProductsToCart($products);
     $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LogoutCustomerOnFrontendStep', ['customer' => $customer])->run();
     return ['products' => $products];
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:17,代碼來源:AbandonedCartsReportEntityTest.php

示例7: testDeleteCustomerBackendEntity

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

示例8: applyCustomerGroup

 /**
  * Create customer with customer group and apply customer group to catalog price rule.
  *
  * @param CatalogRule $catalogPriceRule
  * @param Customer|null $customer
  * @return CustomerGroup
  */
 public function applyCustomerGroup(CatalogRule $catalogPriceRule, Customer $customer = null)
 {
     if ($customer !== null) {
         $customer->persist();
         /** @var \Magento\Customer\Test\Fixture\CustomerGroup $customerGroup */
         $customerGroup = $customer->getDataFieldConfig('group_id')['source']->getCustomerGroup();
         $catalogPriceRule = $this->fixtureFactory->createByCode('catalogRule', ['data' => array_merge($catalogPriceRule->getData(), ['customer_group_ids' => $customerGroup->getCustomerGroupCode()])]);
     }
     return $catalogPriceRule;
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:17,代碼來源:CreateCatalogRuleTest.php

示例9: testCreateExistingCustomer

 /**
  * Create Existing Customer account on frontend.
  *
  * @param Customer $customer
  * @return void
  */
 public function testCreateExistingCustomer(Customer $customer)
 {
     // Precondition
     $existingCustomer = clone $customer;
     $customer->persist();
     // Steps
     $this->cmsIndex->open();
     $this->cmsIndex->getLinksBlock()->openLink('Create an Account');
     $this->customerAccountCreate->getRegisterForm()->registerCustomer($existingCustomer);
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:16,代碼來源:CreateExistingCustomerFrontendEntity.php

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

示例11: test

 /**
  * New Accounts Report.
  *
  * @param Customer $customer
  * @param array $customersReport
  * @return void
  */
 public function test(Customer $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:niranjanssiet,項目名稱:magento2,代碼行數:17,代碼來源:NewAccountsReportEntityTest.php

示例12: test

 /**
  * Runs Delete Customer Address test.
  *
  * @param Customer $customer
  * @return array
  */
 public function test(Customer $customer)
 {
     // Precondition:
     $customer->persist();
     $addressToDelete = $customer->getDataFieldConfig('address')['source']->getAddresses()[1];
     // Steps:
     $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     $this->customerAccountIndex->getAccountMenuBlock()->openMenuItem('Address Book');
     $this->customerAccountIndex->getAdditionalAddressBlock()->deleteAdditionalAddress($addressToDelete);
     return ['deletedAddress' => $addressToDelete];
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:17,代碼來源:DeleteCustomerAddressTest.php

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

示例14: test

 /**
  * Delete products form default wish list.
  *
  * @param Customer $customer
  * @param string $products
  * @param array $removedProductsIndex
  * @return array
  */
 public function test(Customer $customer, $products, array $removedProductsIndex)
 {
     // Preconditions
     $customer->persist();
     $this->loginCustomer($customer);
     $products = $this->createProducts($products);
     $this->addToWishlist($products);
     // Steps
     $this->cmsIndex->getLinksBlock()->openLink("My Wish List");
     $removeProducts = $this->removeProducts($products, $removedProductsIndex);
     return ['products' => $removeProducts, 'customer' => $customer];
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:20,代碼來源:DeleteProductsFromWishlistOnFrontendTest.php

示例15: test

 /**
  * Run suggest searching result test.
  *
  * @param Customer $customer
  * @param string $products
  * @param int $qty
  * @return array
  */
 public function test(Customer $customer, $products, $qty)
 {
     // Preconditions
     $customer->persist();
     $this->loginCustomer($customer);
     $products = $this->createProducts($products);
     $this->addToWishlist($products);
     // Steps
     $this->addToCart($products, $qty);
     // Prepare data for asserts
     $cart = $this->createCart($products);
     return ['products' => $products, 'customer' => $customer, 'cart' => $cart];
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:21,代碼來源:AddProductsToCartFromCustomerWishlistOnFrontendTest.php


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