本文整理汇总了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];
}
示例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);
}
示例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);
}
}
示例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];
}
示例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];
}
示例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();
}
示例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;
}
示例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);
}
示例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();
}
示例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);
}
示例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];
}
示例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();
}
示例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];
}
示例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