本文整理汇总了PHP中Magento\Customer\Test\Fixture\Customer::getEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP Customer::getEmail方法的具体用法?PHP Customer::getEmail怎么用?PHP Customer::getEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Customer\Test\Fixture\Customer
的用法示例。
在下文中一共展示了Customer::getEmail方法的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()]);
}
示例2: 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
示例3: selectCustomer
/**
* Select customer if it is present in fixture or click create new customer button.
*
* @param CustomerFixture $customer
* @return void
*/
public function selectCustomer(CustomerFixture $customer)
{
if ($customer->hasData('id')) {
$this->searchAndOpen(['email' => $customer->getEmail()]);
} else {
$this->_rootElement->find($this->createNewCustomer)->click();
}
$this->getTemplateBlock()->waitLoader();
}
示例4: 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();
}
示例5: processAssert
/**
* Assert that deleted customers address is not displayed on backend during order creation
*
* @param OrderIndex $orderIndex
* @param OrderCreateIndex $orderCreateIndex
* @param Address $deletedAddress
* @param Customer $customer
* @return void
*/
public function processAssert(OrderIndex $orderIndex, OrderCreateIndex $orderCreateIndex, Address $deletedAddress, Customer $customer)
{
$filter = ['email' => $customer->getEmail()];
$orderIndex->open()->getGridPageActions()->addNew();
$orderCreateIndex->getCustomerBlock()->searchAndOpen($filter);
$orderCreateIndex->getStoreBlock()->selectStoreView();
$actualAddresses = $orderCreateIndex->getCreateBlock()->getBillingAddressBlock()->getExistingAddresses();
$addressRenderer = $this->objectManager->create('Magento\\Customer\\Test\\Block\\Address\\Renderer', ['address' => $deletedAddress]);
$addressToSearch = $addressRenderer->render();
\PHPUnit_Framework_Assert::assertFalse(in_array($addressToSearch, $actualAddresses), 'Deleted address is present on backend during order creation');
}
示例6: 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();
}
示例7: authorize
/**
* Authorize customer on frontend.
*
* @param Customer $customer
* @throws \Exception
* @return void
*/
protected function authorize(Customer $customer)
{
$url = $_ENV['app_frontend_url'] . 'customer/account/login/';
$this->transport->write($url);
$this->read();
$url = $_ENV['app_frontend_url'] . 'customer/account/loginPost/';
$data = ['login[username]' => $customer->getEmail(), 'login[password]' => $customer->getPassword(), 'form_key' => $this->formKey];
$this->transport->write($url, $data, CurlInterface::POST, ['Set-Cookie:' . $this->cookies]);
$response = $this->read();
if (strpos($response, 'customer/account/login')) {
throw new \Exception($customer->getFirstname() . ', cannot be logged in by curl handler!');
}
}
示例8: processAssert
/**
* Assert customer info in Abandoned Carts report (Reports > Abandoned carts):
* – name and email
* – products and qty
* – created and updated date
*
* @param AbandonedCarts $abandonedCarts
* @param array $products
* @param Customer $customer
* @return void
*/
public function processAssert(AbandonedCarts $abandonedCarts, $products, Customer $customer)
{
$abandonedCarts->open();
$qty = 0;
foreach ($products as $product) {
$qty += $product->getCheckoutData()['qty'];
}
$filter = ['customer_name' => $customer->getFirstname() . " " . $customer->getLastname(), 'email' => $customer->getEmail(), 'items_count' => count($products), 'items_qty' => $qty, 'created_at' => date('m/j/Y'), 'updated_at' => date('m/j/Y')];
$abandonedCarts->getGridBlock()->search($filter);
$filter['created_at'] = date('M j, Y');
$filter['updated_at'] = date('M j, Y');
\PHPUnit_Framework_Assert::assertTrue($abandonedCarts->getGridBlock()->isRowVisible($filter, false, false), 'Expected customer info is absent in Abandoned Carts report grid.');
}
示例9: 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.');
}
示例10: test
/**
* Run Lock customer on login page test.
*
* @param Customer $initialCustomer
* @param int $attempts
* @param FixtureFactory $fixtureFactory
* @param $incorrectPassword
* @param string $configData
* @return void
*/
public function test(Customer $initialCustomer, $attempts, FixtureFactory $fixtureFactory, $incorrectPassword, $configData = null)
{
$this->configData = $configData;
// Preconditions
$this->objectManager->create('Magento\\Config\\Test\\TestStep\\SetupConfigurationStep', ['configData' => $this->configData])->run();
$initialCustomer->persist();
$incorrectCustomer = $fixtureFactory->createByCode('customer', ['data' => ['email' => $initialCustomer->getEmail(), 'password' => $incorrectPassword]]);
// Steps
for ($i = 0; $i < $attempts; $i++) {
$this->customerAccountLogin->open();
$this->customerAccountLogin->getLoginBlock()->fill($incorrectCustomer);
$this->customerAccountLogin->getLoginBlock()->submit();
}
}
示例11: test
/**
* Move compare products on order page.
*
* @param Customer $customer
* @param string $products
* @return array
*/
public function test(Customer $customer, $products)
{
// Preconditions
// Create products
$products = $this->objectManager->create('\\Magento\\Catalog\\Test\\TestStep\\CreateProductsStep', ['products' => $products])->run()['products'];
// Add products to compare
foreach ($products as $itemProduct) {
$this->browser->open($_ENV['app_frontend_url'] . $itemProduct->getUrlKey() . '.html');
$this->catalogProductView->getViewBlock()->clickAddToCompare();
}
// Steps
$this->customerIndex->open();
$this->customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $customer->getEmail()]);
$this->customerIndexEdit->getPageActionsBlock()->createOrder();
$this->orderCreateIndex->getStoreBlock()->selectStoreView();
$activitiesBlock = $this->orderCreateIndex->getCustomerActivitiesBlock();
$activitiesBlock->getProductsInComparisonBlock()->addProductsToOrder($products);
$activitiesBlock->updateChanges();
return ['products' => $products, 'productsIsConfigured' => false];
}
示例12: processAssert
/**
* Assert that customer forgot password message is present on customer account forgot password page.
*
* @param CustomerAccountLogin $customerLogin
* @param Customer $customer
* @return void
*/
public function processAssert(CustomerAccountLogin $customerLogin, Customer $customer)
{
$message = sprintf(self::SUCCESS_MESSAGE_FIRST_PART . self::SUCCESS_MESSAGE_SECOND_PART, $customer->getEmail());
\PHPUnit_Framework_Assert::assertEquals($message, $customerLogin->getMessages()->getSuccessMessages(), 'Wrong forgot password message is displayed.');
}
示例13: processAssert
/**
* Assert that error message "Please correct this email address: "%email%"." is displayed
* after customer with invalid email save
*
* @param Customer $customer
* @param CustomerIndexNew $pageCustomerIndexNew
* @return void
*/
public function processAssert(Customer $customer, CustomerIndexNew $pageCustomerIndexNew)
{
$expectMessage = str_replace('%email%', $customer->getEmail(), self::ERROR_EMAIL_MESSAGE);
$actualMessage = $pageCustomerIndexNew->getMessagesBlock()->getErrorMessage();
\PHPUnit_Framework_Assert::assertEquals($expectMessage, $actualMessage, 'Wrong success message is displayed.' . "\nExpected: " . $expectMessage . "\nActual: " . $actualMessage);
}
示例14: run
/**
* Open customer account
*
* @return void
*/
public function run()
{
$this->customerIndex->open();
$this->customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $this->customer->getEmail()]);
}
示例15: processAssert
/**
* Assert that login again to frontend with new password was success.
*
* @param FixtureFactory $fixtureFactory
* @param CustomerAccountIndex $customerAccountIndex
* @param Customer $initialCustomer
* @param Customer $customer
* @return void
*/
public function processAssert(FixtureFactory $fixtureFactory, CustomerAccountIndex $customerAccountIndex, Customer $initialCustomer, Customer $customer)
{
$customer = $fixtureFactory->createByCode('customer', ['dataset' => 'default', 'data' => ['email' => $initialCustomer->getEmail(), 'password' => $customer->getPassword(), 'password_confirmation' => $customer->getPassword()]]);
$this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
\PHPUnit_Framework_Assert::assertTrue($customerAccountIndex->getAccountMenuBlock()->isVisible(), 'Customer Account Dashboard is not visible.');
}